Skip to content

fix(app-shell): the draft bar publishes the reloaded draft after a conflict "reload" (#37648) - #37715

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-th9squ
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-th9squ

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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 publishItem pin docs).

What changes

  • Draft bar after a conflict "reload" (@object-ui/app-shell). A view settings Save refused because the draft moved opens the draft-conflict dialog. On "reload", ViewConfigPanel re-read the stored view into its buffer, but handleViewConfigSave answers false on 'reloaded', so no savedSignal reached RuntimeDraftBar, which kept the draft version it read on open. Its Publish was then pinned to a draft that had moved, refused 409 METADATA_CONFLICT, until the panel was reopened.
    • The guard's reload callback is now 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 (the If-Match of the read's pin; absent when the read named none) and reloadedHasDraft (whether a pending draft was served).
    • RuntimeDraftBar takes them as it takes savedSignal: the Publish is pinned to reloadedDraftVersion, and the indicator follows reloadedHasDraft. 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).
    • A reload whose read fails installs no buffer and hands the bar nothing, so its Publish stays pinned to the draft it showed and is refused, never sent unpinned.
  • client.meta.publishItem (@objectstack/client). The parentVersion JSDoc now says an empty string pins nothing and is not sent, as draftVersion's does (N1). JSDoc only; metaPublishHeaders already treated '' so.
  • Client SDK page (content/docs/api/client-sdk.mdx). The publishItem example now shows a publish pinned with draftVersion (a draft save's receipt version) and parentVersion (the version the earlier publish returned), with the refusal and the empty-string rule (N2).

Decisions made here

Verification

  • New tests, red on main and 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 with reloadedHasDraft: true (the landed-save signal unmoved); a reload that finds no pending draft hands reloadedHasDraft: false and no version.
    • RuntimeDraftBar.test.tsx (3): the Publish after reloadedSignal sends draftVersion = 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).
  • vitest over every ViewConfigPanel*, RuntimeDraftBar*, ObjectView*, DraftConflictDialog* and viewCacheInvalidation* test: 1,059 green. tsc for app-shell (tsconfig.json and tsconfig.test.json) on the changed files: clean; eslint: 0 errors. check-doc-anchors: pass.
  • overlap-check: exit 0 (no open PR touches these files).
  • Premise: static read on main (handleViewConfigSave's 'reloaded' → false; the bar sets its pin only on open and on savedSignal), and the red tests above.

Clause-②: no
Metadata-protocol: none
Skills-docs: none

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (No spec change.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; eslint on the changed files passes (the full pnpm lint runs in CI).
  • 4. One issue, one branch off an up-to-date main, one pull request.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri

…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>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing 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): node scripts/docs-audit/affected-docs.mjs --json f722411eddac2c3e34235cd7a5ba1ccdda4d40d4 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head 0b1ca27 · card #37648 · area s2-ux-L · 2026-11-26T23:43Z

L1 checklist

  • Shape and relation. l1-face.mjs --pr 37715 read 13 items and flagged none; 70 check-runs on this head, 61 success, 9 skipped, none failed; mergeable_state clean. Seven files, +230 / −3: the runtime draft bar and the view settings panel with their tests, one @objectstack/client jsdoc sentence, the client SDK page, and patch changesets on @object-ui/app-shell and @objectstack/client.
  • Fixes #37648 is right. After a refused save is resolved with "reload" in the draft-conflict dialog, the panel hands the draft bar the draft version its own re-read found (reloadedSignal / reloadedDraftVersion / reloadedHasDraft), so the bar's Publish is pinned to the draft it now shows; the bar never re-reads on its own, and a re-read that could not install a buffer hands it nothing, so the Publish stays pinned to the draft it showed and is refused, never sent unpinned. Read against the diff: the initial mount is skipped, and the signal only moves on a conflict reload.
  • Contract review. No contract face on this file list (record-recognisers --brief-template --paths decides none): no spec path, one comment-only client jsdoc, Clause-②: no, Metadata-protocol: none. The seat's ACCEPT at TIER_DEFAULT is the review of record.
  • Governance. check-governed-merges.mjs: not governed. Tier S.

Tier: S. Landing: ready + auto-merge by this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 23:44
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 94843b8 Nov 27, 2026
71 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-th9squ branch November 27, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review follow-ups of PR #37637: the runtime draft bar keeps a stale token after "reload", publishItem pin docs

2 participants