You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 94843b8
Browse filesBrowse the repository at this point in the historyBrowse files
fix(app-shell): the draft bar publishes the reloaded draft after a conflict "reload" (#37648) (#37715)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuDJAbBe3iTrFcF7GZrucZ32)_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 (#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
- **Only `ViewConfigPanel` is changed.** It is the one host of
`RuntimeDraftBar` with a draft-conflict guard (`useDraftSaveGuard`);
`ReportConfigPanel` and `ReportView` host the bar without one, so no
"reload" reaches them.
- **The bar takes the panel's read, not a read of its own,** for the
#36350 reason above; and only the read that answers a "reload" is handed
over, so an ordinary open, publish or discard behaves as before.
## 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
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No spec change.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `eslint` on the changed files passes (the
full `pnpm lint` runs in CI).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri
Co-authored-by: Claude <noreply@anthropic.com>
fix(app-shell): the view settings draft bar publishes the reloaded draft after a conflict is resolved with "reload"
7
+
8
+
When a view settings Save was refused because the draft moved and the author chose "reload" in the conflict dialog, the panel re-read the stored view but the draft bar kept the draft version it had read before the reload. Its Publish was then pinned to a draft that no longer existed and was refused until the panel was reopened. The panel now hands the bar the version its reload read found (`RuntimeDraftBar`'s new `reloadedSignal`, `reloadedDraftVersion` and `reloadedHasDraft`), so the Publish promotes the draft now shown, and a reload that found no pending draft takes the bar's indicator down. A reload whose read fails hands the bar nothing, so its Publish stays pinned and is refused rather than sent unpinned.
9
+
10
+
`client.meta.publishItem`'s `parentVersion` JSDoc now says an empty string pins nothing and is not sent, as `draftVersion`'s does, and the client SDK page shows a publish pinned with `draftVersion` and `parentVersion`.
0 commit comments