Skip to content

chore: add 'no symptom patching' rule + fix timezone-fragile test#471

Merged
Seifert69 merged 1 commit into
mainfrom
process-rule-and-test-tz-fix
May 9, 2026
Merged

chore: add 'no symptom patching' rule + fix timezone-fragile test#471
Seifert69 merged 1 commit into
mainfrom
process-rule-and-test-tz-fix

Conversation

@Seifert69

Copy link
Copy Markdown
Contributor

Two unrelated cleanups bundled because they're both tiny.

CLAUDE.md — new "Debugging & root cause" section codifying a recurring anti-pattern we saw in PR #460 ("fix forward sheet freeze") and PR #455 ("wrap reads in remember to prevent layout crash"): observe a freeze / ANR / unexplained behaviour, ship a workaround that hides the symptom, move on. The rule: capture concrete evidence (stack trace, ANR dump, profiler sample, repro test) before fixing, and if you can't capture evidence, install the instrumentation that will. Lists four named anti-patterns drawn from real cases so it's clear what's prohibited.

MessageProcessingPipelineTest.kt — fix messagesOnSameDay_shareOneSection which fails locally in CPH and any TZ east of UTC+0:47. Root cause: baseTime = 1_700_000_000_000L decodes to 2023-11-14T22:13:20Z. The test creates messages at offsets 0/30/60 minutes; in UTC+1 the +60min message lands at 00:13 the next day, producing 2 sections instead of 1. Pinned baseTime to noon UTC (1_699_963_200_000L) so offsets up to ±12h stay on the same calendar date. Other tests in the file deliberately cross day boundaries (24h, 25h offsets) and still do. CI runners default to UTC so this never surfaced there.

Two unrelated cleanups bundled because they're both tiny.

CLAUDE.md — new "Debugging & root cause" section codifying a recurring
anti-pattern we saw in PR #460 ("fix forward sheet freeze") and PR #455
("wrap reads in remember to prevent layout crash"): observe a freeze /
ANR / unexplained behaviour, ship a workaround that hides the symptom,
move on. The rule: capture concrete evidence (stack trace, ANR dump,
profiler sample, repro test) before fixing, and if you can't capture
evidence, install the instrumentation that will. Lists four named
anti-patterns drawn from real cases so it's clear what's prohibited.

MessageProcessingPipelineTest.kt — fix `messagesOnSameDay_shareOneSection`
which fails locally in CPH and any TZ east of UTC+0:47. Root cause:
`baseTime = 1_700_000_000_000L` decodes to `2023-11-14T22:13:20Z`. The
test creates messages at offsets 0/30/60 minutes; in UTC+1 the +60min
message lands at 00:13 the next day, producing 2 sections instead of 1.
Pinned baseTime to noon UTC (1_699_963_200_000L) so offsets up to ±12h
stay on the same calendar date. Other tests in the file deliberately
cross day boundaries (24h, 25h offsets) and still do. CI runners
default to UTC so this never surfaced there.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Seifert69 Seifert69 merged commit 63ea8b5 into main May 9, 2026
4 checks passed
@Seifert69 Seifert69 deleted the process-rule-and-test-tz-fix branch May 9, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant