feat: retention flag, narrow release - #305
Merged
Merged
Conversation
Narrow half of the rooms.retained migration (ADR-0019). The field becomes required, by_activity is dropped, and the sweep reads by_retention_activity for non-retained rooms past the cutoff. The completed backfill migration is removed; every raw room insert in tests and the two Doc<"rooms"> literals in src/ carry retained: false. Must ship in a separate release from #284, after the backfill has run to completion in prod. Claude-Session: https://claude.ai/code/session_01LTuViwbbbictkKbzyZCBaa
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Review: narrow half of
|
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.
Closes #285. Narrow half of the
rooms.retainedmigration (ADR-0019, spec §3 step 3).Release ordering constraint
This must deploy separately from #284 and only after the backfill has run to completion in prod. Every merge to
maindeploys to production, so the merge is the ordering unit: #304 (widen) merged and deployed first, the backfill ran, and this PR merges second. Both may appear in the same release-please changelog; that is fine.Backfill state before this merge (2026-09-04):
backfillRoomsRetainedstamped 78 legacy rooms and a follow-up dry run reported 0 unstamped. The Convex push validates data at rest, so the narrowed schema would refuse to deploy if any room lacked the field.This PR removes the backfill migration (a required field makes its
undefinedindex query a type error, and its job is done). If the narrow push were ever to abort on an unstamped row, recovery is a revert of this PR, not a re-run.What changed
convex/schema.ts:retainedis a required boolean.by_activityis dropped.convex/model/cleanup.ts: the sweep readsby_retention_activitywithretained = falseandlastActivityAtbefore the cutoff. Batch size and scheduling are unchanged.convex/migrations.ts:backfillRoomsRetainedremoved.convex/retention.test.ts: a retained room outlives five quiet days, a non-retained room is scheduled for deletion, and retention is the only discriminator (non-retained rooms withroomTypecanvas and undefined are treated identically).Doc<"rooms">literals insrc/(demo provider and a hook test), gainedretained: false.https://claude.ai/code/session_01LTuViwbbbictkKbzyZCBaa