fix(migrations): sync the preview when an event is re-titled - #77
Merged
Conversation
The feed reads publicEventPreviews, which carries its own copy of the title (and a folded copy for the search index). retitleDivergentEvents patched only events.title, so the 159 events it renamed kept their old headline everywhere a reader could actually see them. The runtime path was already correct — applyEventSummaryResult patches the title and then calls syncPublicEventPreview in the same mutation — so this only ever affected the backfill. Two changes: - retitleDivergentEvents now syncs the preview after patching, so a future run cannot leave the same gap. - resyncStalePreviewTitles repairs the events already renamed. They cannot be fixed by re-running the retitle migration: their event title is now correct, so chooseEventTitle returns null and skips them. This walks previews and resyncs any whose title has drifted from its event. Idempotent, and useful after any direct write to events.title. No cost impact: syncPublicEventPreview is pure database work with no model calls, and event embeddings are not derived from the title. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012MpkuigW6T4N1exXip6bRp
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
The re-title backfill from #75/#76 renamed 159 events but the renames were invisible to readers. This repairs them.
What went wrong
publicEventPreviewsstores its own copy of the title (plus a diacritic-folded copy for the search index), and the feed reads previews, not events.retitleDivergentEventspatched onlyevents.title, so the 159 renamed events kept their old headline everywhere a reader could see them.Verified against production: the feed still returned the original divergent titles after the backfill completed.
The runtime path was already correct —
applyEventSummaryResultpatches the title and callssyncPublicEventPreviewin the same mutation. This only ever affected the backfill.Changes
retitleDivergentEventsnow syncs the preview after patching, so a future run can't leave the same gap.resyncStalePreviewTitlesrepairs the events already renamed. They can't be fixed by re-running the retitle migration: their event title is now correct, sochooseEventTitlereturnsnulland skips them. This walks previews and resyncs any whose title has drifted from its event — idempotent, and useful after any direct write toevents.title.Cost
None ongoing.
syncPublicEventPreviewis pure database work — no model calls, no scheduler, no embeddings — and event embeddings are not derived from the title. The only cost is the one-off backfill pass.Testing
339 passed, 4 skipped,
tscclean.🤖 Generated with Claude Code
Generated by Claude Code