fix(runtime): seed-apply hook passes seeds + resilient read-back (loads published seed rows)#1618
Merged
Merged
Conversation
…ient read-back
The publish-drafts seed-apply hook (applyPublishedSeeds) never actually loaded
rows on a remote-Turso staging env. Two defects:
1. Wrong field: it called SeedLoaderRequestSchema.parse({ datasets, ... }) but
the field was renamed `datasets`→`seeds` in the same PR — this newly-added
constructor was missed (parse takes `unknown`, so tsc didn't catch it).
Pass `seeds: datasets`.
2. Scope-fragile read-back: it read each just-published seed with the active
org only and swallowed misses into an empty list, then reported
success/0-rows. A workspace seed is typically stored env-wide
(organization_id IS NULL), so the org-scoped read found nothing. Now try the
active-org read then fall back to an env-wide read, and if no seed body is
readable return success:false with a diagnostic (never claim success while
loading 0 rows).
Manually verified end-to-end on staging: drafts now publish + the object goes
live; this lands the final step — published seed rows actually load.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Follow-up to #1611. The publish-drafts seed-apply hook fired on staging (
seedAppliedappeared) but loaded 0 rows. Two defects:SeedLoaderRequestSchema.parse({ datasets, … })— the field was renameddatasets→seedsin feat(spec,runtime): makeseeda first-class, publish-applied metadata type #1611 but this newly-added constructor was missed (parsetakesunknown, so tsc didn't flag it). →seeds: datasets.organization_id IS NULL), so the org-scoped read found nothing. Now: try active-org read, fall back to env-wide read; if no body is readable, returnsuccess:false+ diagnostics (never claim success while loading 0 rows).Depends on / completes the staging story alongside cloud #141 (Turso remote null-where fix) which made the drafts readable in the first place.