fix(imessage): catch delayed reflected echoes#59980
Conversation
Greptile SummaryThis PR fixes two related iMessage echo-suppression bugs: the text-fallback TTL in Confidence Score: 5/5Safe to merge — targeted, well-scoped fix with no P0/P1 findings and good test coverage of the new behavior. All findings are P2 or below. The logic change is correct: normalization is symmetric (applied in both remember and has), the TTL extension is bounded by the conversation-scoped key, and the longer-lived message-ID path is untouched. Tests are updated to lock in the new TTL boundary and the corrupted-prefix matching behavior. No files require special attention. Reviews (1): Last reviewed commit: "fix(imessage): catch delayed reflected e..." | Re-trigger Greptile |
|
I reviewed the current AI review surfaces on this PR before making any follow-up changes. What I checked:
Current result:
Because there are no concrete AI review findings to act on, I did not make additional code changes just for the sake of churn. Validation status for the current branch remains:
If another AI review tool posts specific findings later, I can address those directly in a follow-up update. |
Summary
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
extensions/imessage/src/monitor/echo-cache.tsonly normalized CRLF plus trim and expired text fallback entries after 4 seconds, so delayed or prefix-corrupted reflected copies failed exact-text matching.git blame, prior PR, issue, or refactor if known): existing iMessage echo-cache tests documented the 4 second text fallback assumption; the linked issue showed reflected text arriving 5 to 10 seconds later with leadingU+FFFDcharacters.Regression Test Plan (if applicable)
extensions/imessage/src/monitor/monitor-provider.echo-cache.test.ts,extensions/imessage/src/monitor/self-chat-cache.test.ts, andextensions/imessage/src/monitor/self-chat-dedupe.test.ts.User-visible / Behavior Changes
Diagram (if applicable)
N/A
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
pnpmworkspace, Bun/Node repo defaultsSteps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm test -- extensions/imessage/src/monitor/monitor-provider.echo-cache.test.ts extensions/imessage/src/monitor/self-chat-cache.test.ts extensions/imessage/src/monitor/self-chat-dedupe.test.ts extensions/imessage/src/monitor/inbound-processing.test.ts; ranpnpm test:extension imessage; ranpnpm build; also sanity-checked the cache behavior directly before the fix and confirmed 5 second text-only and corrupted-prefix matches failed on the old logic.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
Notes
pnpm checkcurrently fails in unrelated pre-existingextensions/diffs/src/language-hints.test.tstype assertions on this tree; the iMessage-focused tests, extension lane, andpnpm buildpassed for this PR.Made with Cursor