Skip to content

Studio OWD overview Save still publishes unpinned, so two admins saving the same object's sharing default, the later save silently overwrites the earlier #36962

Done
1 of 1 issue completed

Description

@objectstack-fleet

repo:objectstack#7 · os-alice · session_011y7As6kDA9BVrMsBR9rmrJ

Filing gate ① · Source: fleet · found by the #36726 dev (os-dev-report comment 7129863132 on #36726), outside that card's surface; PR #36958 (that card) does not touch it. Pre-existing on main 5385759. Read, not measured: same publish shape that #36726's race tests pin for the four editors it wires.

What happens

ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx:487 publishes each saved object with publishSavedItem(client, { type: 'object', name, packageId }, s.row.hasDraft) and passes no pinned version. The object page and, after #36726, the extension, hook, action and flow editors pass the version their load read, so a publish over a newer published row is refused and the #36601 conflict dialog opens. The OWD overview's Save has no such pin, so two admins who change one object's org-wide default save last-writer-wins.

Done when

reach: Studio OWD overview (public UI door), read from source; repro not measured.
Business reason: two admins setting sharing defaults at once lose one change with no warning; it is a security-relevant setting.
Reader: the o7-studio area of seat repo:objectstack#7.
Dedupe: PackageOwdOverviewPanel publish → 0; unpinned publish → 7, open: #36726 (parent, other editors), #36350 (view drafts, unrelated), the rest seat posts.
Suggested-grade: p2 · area:build · Bug · admins, rare (two concurrent saves of one object's OWD) · read.

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    finding
    on Nov 24, 2026
  2. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: lands in area:build · domain:ui · priority:p2 · Bug · pm:queue · size S.
    Rationale: two admins saving one object's sharing default at once lose one change silently. The race is rare, but what is lost is an access-control setting, and the fix copies #36726's wiring. p2, as suggested. repo:objectstack#7 (o7-studio) takes it when a dev frees, as its request said.

  3. added
    bug
    domain:ui
    pm:queue
    priority:p2
    on Nov 24, 2026
  4. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:build · domain:ui · Bug · priority:p1 · pm:queue · size S; rationale: the OWD overview Save publishes unpinned, so when two admins save one object's org-wide default the later save silently overwrites the earlier one. A silent lost update is p1 whatever the traffic.

    Regraded p2 → p1 on the maintainer's go in the triage session (「升级吧」), after a review of every open p2 card.

  5. added
    priority:p1
    and removed
    priority:p2
    on Nov 26, 2026
  6. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CY2uhJ1AYNPw5TUSVS

    Claim: PM loop round 5
    Session: session_01Utp6CY2uhJ1AYNPw5TUSVS
    Account: os-bill
    Branch: claude/issue-36962-owd-overview-pinned-publish
    Worktree: objectstack-issue-36962
    Domain: domain:ui
    Seat: repo:objectstack#5
    Area: o5-P
    File surface: ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx, new ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.*-36962.test.tsx, one changeset (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default tier (dispatch-gates --tier: "no path-derived mandate"), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: the OWD overview Save was left out when #36726 wired the pinned publish into the Studio editors; pre-existing on main 5385759 (card body)
    Thread-read: none
    Premise: holds — read at origin/main eaa9e54 2026-11-26T08:23Z: PackageOwdOverviewPanel.tsx L487 still calls publishSavedItem(client, { type: 'object', name: s.row.name, packageId }, s.row.hasDraft) with no pinned version.
    Serial constraints cleared: open PRs #37474 and #37478 touch other files in studio-design/ (StudioDesignSurface, studioSaveBar, StudioMenu, studio-tokens); none touches PackageOwdOverviewPanel*. studioSaveBar.tsx is held by #37474 and named by #37440, so it is out of this surface: wire the pin through publishSavedItem's existing parameters only.
    Pre-claim lane: domain:ui, area:build p1 (triage regrade by hotlong 2026-11-26T06:57Z on the maintainer's go); zone o5-P (p1 of every area except ai/ux/data).
    Pre-claim deps: Blocked-by: none (card body).
    Prior rulings read: owd,pinned,publish → hits ADR-0059 Decision §3, ADR-0003 Decision §3, ADR-0018 Decision §3; none rules on the Studio publish pin; thread: none; repo: objectstack-ai/objectstack.

  7. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 26, 2026
  8. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CY2uhJ1AYNPw5TUSVS
    os-dev-report

    {
     "issue": 36962,
     "status": "done",
     "branch": "claude/issue-36962-owd-overview-pinned-publish",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/37501",
     "session": "session_01Utp6CY2uhJ1AYNPw5TUSVS",
     "premise_still_valid": true,
     "summary": "Head e572eb289. PackageOwdOverviewPanel.tsx now holds a useDraftSaveGuard: the load records each row's published pin (publishedPinOfLayers over the row's layers read; a row the published list does not hold pins If-None-Match *; a failed layers read pins nothing) with recordPublished, and the per-row Save passes the guard's publish as publishSavedItem's existing fourth parameter (studioSaveBar.tsx untouched), so a publish over a row another admin published since is refused 409 and the existing conflict dialog asks reload / overwrite / keep editing. Partial save (#36511) kept: other rows go on and go live; a reloaded row drops its edit and is read back; the table re-read keeps each unsaved row pinned to the read its edit was made on (editPinsRef, re-sent because a conflict's reload clears every pin the guard holds). Files: PackageOwdOverviewPanel.tsx +83/-9, new PackageOwdOverviewPanel.publishPinned-36962.test.tsx +287, .changeset/36962-owd-overview-pinned-publish.md +10 (app-shell patch).",
     "tests": "pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel (12 files incl. the new one): Test Files 12 passed, Tests 56 passed, lock VERDICT command-exit 0. New file alone: 7/7 (race+keep editing, reload, overwrite, two rows one raced with kept-pin, one editor no self-conflict, draft-only If-None-Match, unpinned control). Ablation 1 (delete publishPinned from the publishSavedItem call, ablation-replace.mjs anchor 1->0): 6 failed / 1 passed (control green); restored blob == HEAD ac508f43809d, git diff HEAD empty. Ablation 2 (kept = false): 1 failed (two-rows kept-pin case) / 6 passed; restored blob == HEAD. Test imports the panel from source, so no dist rebuild leg applies. pnpm --filter @object-ui/app-shell type-check (tsc --noEmit + tsc -p tsconfig.test.json): VERDICT command-exit 0. eslint on the two touched files: exit 0, 0 errors, 2 warnings identical to the origin/main copy (pre-existing).",
     "gates": "Local: dispatch-gates --commands (38 families) all run, each exit 0 captured before any pipe (incl. pnpm --dir ui exec vitest run scripts/: 172 files passed / 2 skipped); dispatch-gates --ran with exit codes: 38 derived, 38 run, 0 NOT-MEASURED (derived zero). pnpm check:new-line-citations: 0 new, exit 0. Build closure turbo build --filter='@object-ui/app-shell^...' 72/72, VERDICT 0. CI at report time on e572eb289: in_progress (Lint lanes, Type Check lanes, Check Changeset, Check PR Size, Governed Surface Queue Guard, PR-body guards); skipped: Queue verdict, Borrowed queue verdict, Schedule gate, opt-in smoke/upgrade harness. No conclusion read yet: NOT MEASURED, reason: CI not converged at report time.",
     "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/dispatches; relay run 45790242208 did POST /repos/objectstack-ai/objectstack/pulls + POST /repos/objectstack-ai/objectstack/issues/37501/assignees [os-bill]); this report comment via post-stamped.mjs on #36962. git push x3 to the branch (not REST).",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed — the OWD overview's draft save is still unguarded client.save (no draft pin); it re-reads the fresh draft/baseline at Save time and writes only sharingModel over it, so the lost update is at the publish this PR pins. In PR Acceptance notes."
     ],
     "deviations": "Commit trailers: the harness asked for a model-named Co-Authored-By; the repo's pre-push check:commit-card-trailers refused it, so both commits carry the model-free pair Co-authored-by: Claude plus Claude-Session. The 'reload' choice reports the Save as declined even when other rows went live in the pass (as the object page does for a reloaded Save); noted in PR Acceptance notes."
    }
  9. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CY2uhJ1AYNPw5TUSVS
    os-dev-report

    {
     "issue": 36962,
     "status": "done",
     "branch": "claude/issue-36962-owd-overview-pinned-publish",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/37501",
     "session": "session_01Utp6CY2uhJ1AYNPw5TUSVS",
     "premise_still_valid": true,
     "summary": "Rework round for contract review 7188573161 (FAIL), one push. New head dd92c2751 (from e572eb289). M1: doSave now re-sends each row's pin from editPinsRef to the guard (recordPublished) immediately before its publishSavedItem call. A reload on one row clears every pin the guard holds, so before this the rows after it, and a prerequisite confirm after a failed re-read, published unpinned. Rule 9 holds: a reloaded row whose draft was kept stays on its unconfirmed pin, because recordPublished only updates entry.fresh. S1: four new cases, listed under tests. N1: the code comment, changeset and PR body now say a reloaded row with a draft pending before the Save keeps that draft, which carries the edit, and its next Save is asked again. Changeset prose and the PR body were re-read and corrected. The PR body was updated through the relay, and its Acceptance note on the unguarded draft save now points at #37515. Net diff vs main: PackageOwdOverviewPanel.tsx +92/-9, test file +395, changeset +10. This round: +16/-7, +109/-1, +1/-1. Same three files.",
     "tests": "At dd92c2751: pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel: Test Files 12 passed, Tests 60 passed, VERDICT command-exit 0. New file alone: 11/11. The new cases: reload on the first of two raced rows, where the second is still asked and its publish carries its own load's If-Match (beta0); first row refused and kept with the second reloaded, where the kept edit's next Save is pinned to alpha0 and asked; a row with a draft pending before the Save, raced then reloaded, where the draft is kept carrying the edit, no reset, shown under the unpublished-draft mark, and the next Save stays pinned to alpha0 and is asked; a draft-only row whose name another writer published since, where If-None-Match * is refused and nothing goes live. Ablations via scripts/ablation-replace.mjs, each restored with blob == HEAD f3046b31b11e and git diff HEAD empty. (1) Drop publishPinned from the call: 10 failed / 1 passed, the unpinned control green. (2) kept = false: 2 failed (the two kept-edit cases). (3) Delete the pre-publish recordPublished re-send: 1 failed (reload on the first row), 10 passed. 'A refused and kept, B reloaded' stays green under (3) because the end-of-pass load(keep) also re-records kept pins, and ablation 2 covers it. pnpm --filter @object-ui/app-shell type-check: VERDICT command-exit 0. eslint on the two touched files: exit 0, 0 errors, 2 warnings, both pre-existing on origin/main.",
     "gates": "At dd92c2751 the diff covers the same three paths as e572eb289 (38 derived families, all exit 0, recorded in the first report). I re-ran only the families that read the changeset or body, each exit 0: check-adr-0087-registration --base origin/main, check-changeset-no-major, check-empty-changeset, check:nul-bytes, check-closing-keyword-parity, plus pnpm --dir ui run check:new-line-citations (0 new). I did not re-run the other 32 derived families at dd92c2751 (NOT MEASURED: they read the same three paths and every one passed at e572eb289, so CI carries them on this head). CI on dd92c2751 at report time: success for Test Core, Dogfood Regression Gate, Check PR Size, Governed Surface Queue Guard, PR-body guards, filter and Auto Label. Check Changeset was cancelled, most likely superseded by the run the body edit triggered. 17 runs in_progress, 1 queued (Lint, Type Check and UI lanes), 17 skipped, 0 failed. NOT MEASURED: final CI conclusions, because CI had not converged at report time.",
     "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "3 this round: issue_patch on #37501 twice via the relay (runs 45798551050 and the follow-up, each read back identical, 8736 then 8737 bytes; the second restored the blank line before the footer rule, which the first had dropped after a details block), plus this os-dev-report comment on #36962 via post-stamped.mjs. git push x1 (dd92c2751, not REST).",
     "open_questions": [],
     "security_findings": "withheld",
     "out_of_scope_findings": [
      "carrier: #37515 · the unguarded draft client.save, the stale hasDraft and editPinsRef housekeeping (N3); filed by the coordinator, not by me. The PR's Acceptance note now points at it."
     ],
     "deviations": "(1) The PR body was edited after pr_create on the coordinator's explicit instruction, as the relay's issue_patch requires: its last non-empty line is the signed trailer in HTML-comment form, PR_BODY_TRAILER_SHAPE. (2) Two body writes instead of one: the first dropped the blank line between the last details block and the footer rule, so the second restored it. Both read back byte-identical. (3) Of the 38 derived gate families, I re-ran only the changeset-reading ones at the new head, as stated under gates."
    }
  10. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CY2uhJ1AYNPw5TUSVS

    ACCEPT → PR #37501 comment 7189568354 (seat repo:objectstack#5 L1, head dd92c275); delta contract record 7189094603 PASS (Security-touching: yes). Landing by zone o5-P · 2026-11-26T10:36Z. Follow-up: #37515.

  11. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CY2uhJ1AYNPw5TUSVS

    Close-out (zone o5-P) · 2026-11-26T11:22Z
    Delivered: PR #37501 merged (98cc0e4): the Studio OWD overview's Save publishes each changed object pinned to the published version its load read (publishSavedItem's existing pin parameter, re-sent from the row's edit pin before each publish), so a publish over another admin's newer change is refused with the #36601 conflict dialog instead of silently overwriting; the #36511 partial save is kept. Seat contract PASS 7189094603 (Security-touching: yes), ACCEPT 7189568354. One queue ejection by #37436's ledger miss (anchor #37525), re-armed once.
    State: pm:dispatched removed with the close. Remaining: #37515 (unguarded draft client.save, stale hasDraft, editPinsRef housekeeping, the failed-/layers-read unpinned publish).

  12. removed
    pm:dispatched
    on Nov 26, 2026
  13. added 2 commits that reference this issue on Dec 1, 2026
    98cc0e4
    b69f715
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:buildbugdomain:uifindingpriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions