Skip to content

fix(migrations): sync the preview when an event is re-titled - #77

Merged
flvvius merged 1 commit into
mainfrom
claude/resync-preview-titles
Aug 27, 2026
Merged

fix(migrations): sync the preview when an event is re-titled#77
flvvius merged 1 commit into
mainfrom
claude/resync-preview-titles

Conversation

@flvvius

@flvvius flvvius commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

The re-title backfill from #75/#76 renamed 159 events but the renames were invisible to readers. This repairs them.

What went wrong

publicEventPreviews stores its own copy of the title (plus a diacritic-folded copy for the search index), and the feed reads previews, not events. retitleDivergentEvents patched only events.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 correctapplyEventSummaryResult patches the title and calls syncPublicEventPreview in the same mutation. This only ever affected the backfill.

Changes

  • retitleDivergentEvents now syncs the preview after patching, so a future run can't leave the same gap.
  • resyncStalePreviewTitles repairs the events already renamed. They can't 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.

Cost

None ongoing. syncPublicEventPreview is 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, tsc clean.

🤖 Generated with Claude Code


Generated by Claude Code

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
@flvvius
flvvius merged commit 25ec427 into main Aug 27, 2026
1 of 3 checks passed
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
news-web Building Building Preview Aug 27, 2026 7:21pm

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a309fcb9-ff59-400f-8a23-22c915dac8af


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants