Repository navigation
Remove stale guests and hosts when re-syncing a show - #2328
Merged
Merged
Conversation
The show sync only ever added ShowGuest rows and connected hosts, so when an episode was renumbered (Effect.ts 1057 -> 1056) its guest stayed linked to the old number and showed up on the next episode that took it. Guests not listed in the frontmatter are now unlinked from the show (only when every listed guest saved successfully), and hosts are replaced with `set` on update when the file has a hosts key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle ReportChanges will increase total bundle size by 8.99MB (100.0%) ⬆️
Affected Assets, Files, and Routes:view changes for bundle: website-__sveltekit_yc6xi2.app-client-esmApp Routes Affected:
view changes for bundle: website-__sveltekit_yc6xi2.app-server-esmApp Routes Affected:
|
This branch was successfully deployed
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.
Problem
Episode 1057 (Write Once, Deploy Everywhere) shows Michael Arnaldi as a guest. The Effect.ts episode was originally published as 1057 and later renumbered to 1056 (#2320). The sync only ever adds
ShowGuestrows and connects hosts, so the guest link onsyntax_podcast_show_1057survived when today's episode overwrote that row.Fix (
src/server/shows.ts)ShowGuestrows for that show whose guest isn't listed. Skipped if any guest failed to save, so a failed import can't drop a real guest.setinstead ofconnectwhen the file has ahostskey, so removed hosts are unlinked too. Files withouthostsare untouched.After deploy
The changed-shows sync will skip 1057 since its hash already matches. Run the full import from admin (or touch the 1057 markdown) to clear Michael off it.
🤖 Generated with Claude Code
Note
Medium Risk
Changes podcast sync behavior for relational data; incorrect pruning logic could drop valid host/guest links, though guest deletion is gated on successful imports.
Overview
Show import from markdown now treats front matter as the source of truth for hosts and guests, so renumbered or edited episodes don't leave old associations in the database.
On update, host links use Prisma
setinstead ofconnect, replacing the host list when ahostskey is present (create still connects). After guests are upserted,ShowGuestrows for that show that aren't in the saved list are deleted—but only if every guest import succeeded, so a partial failure won't unlink real guests.Reviewed by Cursor Bugbot for commit 5fd35a4. Bugbot is set up for automated code reviews on this repo. Configure here.