Repository navigation
fix(console): publish pending drafts by ref so package-less drafts can't get stuck - #1621
Merged
Merged
Conversation
…n't get stuck
The home PendingDraftsBanner counted every draft (listDrafts().length) but only
published drafts whose `packageId` was truthy — it POSTed /packages/:id/
publish-drafts. A draft with no package binding (e.g. a dashboard staged without
a packageId) was therefore counted forever and dead-ended on Publish with
"no draft packages", leaving a permanent banner the user could never clear.
Add MetadataClient.publishDraft(type, name) → POST {base}/:type/:name/publish
(promoteDraft — works with NO package), and rewire the banner to publish every
pending draft BY REFERENCE. Package-bound or not, each listed draft now
publishes. Verified against a live tenant: the per-ref endpoint promotes the
draft and clears it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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
The home PendingDraftsBanner ("You have N unpublished change(s) — Publish") counts every draft via
listDrafts().length, but its one-click Publish only handled drafts with a truthypackageId— it POSTed/packages/:id/publish-drafts. A draft staged with no package binding (e.g. a dashboard whosepackage_idcame backnull) was counted forever yet dead-ended on Publish with "no draft packages" — a permanent banner the user could never clear.Root cause confirmed end-to-end on a live tenant: the stuck draft was
dashboard/sales_dashboardwithpackageId: null;sys-metadata-repository.put()stampspackage_id = opts.packageId ?? null,listDrafts()returns it, and the banner's.filter(Boolean)dropped it → empty package list → throw.Fix
MetadataClient.publishDraft(type, name)→POST {base}/:type/:name/publish(the runtime's existing per-refpromoteDraft, which works with no package).(type, name). Package-bound or not, each one publishes — no draft can get stuck.Verified against a live tenant:
POST /api/v1/meta/dashboard/sales_dashboard/publish→ 200, draft list emptied.Test
metadata-clienttests:publishDraftPOSTs the right per-ref URL and throws on non-ok. Suite green (13).app-shelltype-check clean.🤖 Generated with Claude Code