chore: add 'no symptom patching' rule + fix timezone-fragile test#471
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_shareOneSectionwhich fails locally in CPH and any TZ east of UTC+0:47. Root cause:baseTime = 1_700_000_000_000Ldecodes to2023-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.