Repository navigation
fix(app-shell): the draft bar publishes the reloaded draft after a conflict "reload" (#37648) - #37715
Merged
Merged
Conversation
…nflict "reload" (#37648) After a view settings Save was refused and the author chose "reload" in the draft-conflict dialog, ViewConfigPanel re-read the stored view but RuntimeDraftBar kept the draft version it read before the reload, so its Publish was refused until the panel was reopened. The panel's reload read now hands the bar the version it found (`reloadedSignal`, `reloadedDraftVersion`, `reloadedHasDraft`); the bar never re-reads for it. Also: `meta.publishItem`'s `parentVersion` JSDoc says an empty string pins nothing, and the client SDK page shows a publish pinned with `draftVersion` and `parentVersion` (review N1, N2 of PR #37637). Claude-Session: https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri Co-authored-by: Claude <noreply@anthropic.com>
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 21 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head 0b1ca27 · card #37648 · area s2-ux-L · 2026-11-26T23:43ZL1 checklist
Tier: S. Landing: ready + auto-merge by this stroke. |
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.
Requested by Sales · project thread
Fixes #37648
The three review follow-ups PR #37637 left on card #37440: N6 of #37387's review (the runtime draft bar keeps a stale token after "reload") and N1, N2 of contract review 7198547999 (the
publishItempin docs).What changes
@object-ui/app-shell). A view settings Save refused because the draft moved opens the draft-conflict dialog. On "reload",ViewConfigPanelre-read the stored view into its buffer, buthandleViewConfigSaveanswersfalseon'reloaded', so nosavedSignalreachedRuntimeDraftBar, which kept the draft version it read on open. Its Publish was then pinned to a draft that had moved, refused409 METADATA_CONFLICT, until the panel was reopened.handleConflictReload, which marks the next stored-view read as the reload's. That read, once it installs a buffer, hands the bar the version it found:reloadedSignal(bumped),reloadedDraftVersion(theIf-Matchof the read's pin; absent when the read named none) andreloadedHasDraft(whether a pending draft was served).RuntimeDraftBartakes them as it takessavedSignal: the Publish is pinned toreloadedDraftVersion, and the indicator followsreloadedHasDraft. The bar never re-reads for it (Publish of a view draft takes a draft-version precondition, so an unpinned draft write cannot be published by Save to this view (after #36137) #36350: a re-read would pin whatever draft is pending by then, which the panel never showed).client.meta.publishItem(@objectstack/client). TheparentVersionJSDoc now says an empty string pins nothing and is not sent, asdraftVersion's does (N1). JSDoc only;metaPublishHeadersalready treated''so.content/docs/api/client-sdk.mdx). ThepublishItemexample now shows a publish pinned withdraftVersion(a draft save's receiptversion) andparentVersion(the version the earlier publish returned), with the refusal and the empty-string rule (N2).Decisions made here
ViewConfigPanelis changed. It is the one host ofRuntimeDraftBarwith a draft-conflict guard (useDraftSaveGuard);ReportConfigPanelandReportViewhost the bar without one, so no "reload" reaches them.Verification
mainand green here (4 red with the two source files reverted):ViewConfigPanel.pinnedDraftSave-36137.test.tsx(2): another writer's draft moves past the panel's receipt, the next Save is refused, "reload" hands the bar that writer's draft version withreloadedHasDraft: true(the landed-save signal unmoved); a reload that finds no pending draft handsreloadedHasDraft: falseand no version.RuntimeDraftBar.test.tsx(3): the Publish afterreloadedSignalsendsdraftVersion= the reloaded version with no second draft read; a reload with no draft takes the indicator down; the mount's own signal changes nothing (control).vitestover everyViewConfigPanel*,RuntimeDraftBar*,ObjectView*,DraftConflictDialog*andviewCacheInvalidation*test: 1,059 green.tscforapp-shell(tsconfig.jsonandtsconfig.test.json) on the changed files: clean;eslint: 0 errors.check-doc-anchors: pass.overlap-check: exit 0 (no open PR touches these files).main(handleViewConfigSave's'reloaded'→false; the bar sets its pin only on open and onsavedSignal), and the red tests above.Clause-②: no
Metadata-protocol: none
Skills-docs: none
Human Minimum
packages/specholds no runtime logic. (No spec change.)eslinton the changed files passes (the fullpnpm lintruns in CI).main, one pull request.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri