Skip to content

fix(server): remove retracted messages after revert - #22

Merged
asfires merged 1 commit into
mainfrom
t3code/retraction-message-orphan
Aug 12, 2026
Merged

asfires merged 1 commit into
mainfrom
t3code/retraction-message-orphan

Conversation

@asfires

@asfires asfires commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Esc-retracted user messages survived the revert on long threads: capped checkpoint retention leaves a user-message count shortfall, and both projection paths' backfill fallbacks admitted the retracted null-turn message as filler (observed live: 9/11 retractions on a long thread cleaned fully, the 2 past the checkpoint cap leaked).

The thread.reverted payload already carries the retracted messageId, so both retention passes (in-memory projector + sqlite ProjectionPipeline) now exclude it from linkage and backfill. Migration 044 sweeps existing orphans (table-guarded, idempotent; verified against a copy of the live DB — deletes exactly the 2 known orphan rows out of 1,064).

Tests: leak repro pre-fix now passing, fallback regression guard, migration exact-cleanup/no-op-rerun — 60 passing across the retraction suites; server typecheck clean.

Long-thread reverts could backfill a retracted null-turn user message when capped checkpoint retention left a count shortfall.

Exclude completed retraction message IDs from both projection retention passes and clean existing completed-retraction orphans in migration 044.

Model and harness: GPT-5 via Codex
@github-actions github-actions Bot added size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Aug 12, 2026
@asfires
asfires merged commit def9c8c into main Aug 12, 2026
6 of 10 checks passed
@asfires
asfires deleted the t3code/retraction-message-orphan branch August 12, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant