Repository navigation
fix(discord): retry stale preview cleanup after final delivery - #104893
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 12:03 AM ET / 04:03 UTC. Summary PR surface: Source +34, Tests +171. Total +205 across 5 files. Reproducibility: yes. The issue and PR provide a deterministic current-main failing path where the first preview DELETE rejects and the stored ID is unavailable to a second clear, plus live Discord confirmation of the user-visible stale-preview outcome. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the refined stateful lifecycle design, preserve standalone claim-before-delete semantics, and rerun the redacted failed-first-DELETE Discord scenario on current head before merge. Do we have a high-confidence way to reproduce the issue? Yes. The issue and PR provide a deterministic current-main failing path where the first preview DELETE rejects and the stored ID is unavailable to a second clear, plus live Discord confirmation of the user-visible stale-preview outcome. Is this the best way to solve the issue? Yes. The current head is the narrowest maintainable fix because it keeps retry policy at existing lifecycle boundaries, claims targets before asynchronous deletion to prevent duplicate clears, and preserves replacement IDs rather than adding timers, queues, configuration, or extra final sends. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1aff6da8274c. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +34, Tests +171. Total +205 across 5 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (5 earlier review cycles)
|
|
@clawsweeper re-review The PR body now includes redacted live Discord proof on exact head
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The PR body now contains the complete accessible redacted diagnostic manifest, including the controlled first DELETE 500, retained ownership, one final reply, one teardown retry, and preview 404/final 200 postconditions. CI attribution is also complete: the three remaining terminal-session shard failures reproduce on current |
|
Exact-head/current-main CI classification for the remaining session-rotation failures:
Result on the exact PR head: Result on current main with the same focused case: The relevant intervening commit is This classifies the observed failure as branch drift in untouched session-test infrastructure, not a Discord preview-cleanup regression. Rebasing the PR onto current main should bring the fixture repair into the branch; no Discord-side change is indicated by this failure. |
8de9d6d to
db2d6db
Compare
db2d6db to
574cc1e
Compare
|
Maintainer preparation complete at What changed beyond the original patch:
Proof:
|
|
Merged via squash.
|
…law#104893) * fix(discord): retry stale preview cleanup * test(channels): use compatible deferred helper * test(channels): satisfy deferred lint * chore: prepare Discord preview cleanup * fix(channels): retain failed draft cleanup targets * fix(channels): separate draft cleanup callbacks * fix(channels): claim standalone draft cleanup ids --------- Co-authored-by: Cad from Arca <[email protected]> Co-authored-by: Colin <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
Closes #104865
What Problem This Solves
Discord partial streaming can leave a stale preview beside the fresh final reply when preview deletion fails transiently. The old lifecycle released the only retry target before awaiting Discord's DELETE.
Why This Change Was Made
The shared finalizable-draft lifecycle now owns failed deletion targets until a later clear succeeds. Cleanup is serialized, replacement IDs survive an in-flight clear, and post-DELETE bookkeeping failures are not mistaken for remote deletion failures.
Discord keeps one bounded teardown retry after successful fresh-final delivery. Mattermost now uses the same lifecycle-owned clear path. Finalized-in-place previews remain untouched.
User Impact
A transient Discord preview cleanup failure receives one recovery attempt during normal teardown. The final reply is still sent exactly once. No timer, configuration, background queue, or extra final-message send was added.
Evidence
574cc1ea367cc3c24fd81334833988cfc4dd86c3.1a9061321745a1d8468932d252b515c5a968d4ac.tbx_01kxcr0r94tc3rrmzk1g3j7rxg(run): 169/169 focused tests passed across shared draft controls, Discord draft/process handling, and Mattermost draft handling.oxfmt --checkandgit diff --checkpassed.574cc1ea367cc3c24fd81334833988cfc4dd86c3.run_4627a4bad139forced the first preview DELETE to HTTP 500, observed exactly one real final reply, forwarded one teardown retry to Discord, then observed preview GET 404 and final GET 200.5582df93dfe17ac4ec3d8c39dc3d9a857a9f5bf5. Later maintainer commits strengthened shared ownership and concurrency semantics; focused tests cover failed-target retention, overlapping clears, replacement IDs, successful-DELETE callback failures, bounded Discord retry, and finalized-in-place preservation.The live artifact omits credentials, broker data, guild/channel/application/message IDs, endpoints, and message content. The first 500 is controlled fault injection because a transient Discord 5xx cannot be requested deterministically; the retry and both postconditions are live Discord API results.
AI Assistance
AI-assisted by Cad from Arca. Maintainer review, refactor, focused proof, source-blind validation, and exact-head landing checks were completed independently.