Repository navigation
fix(plugin-sharing): a refused write on a federated object whose mapped owner column the driver did not serve is logged again - #27760
Conversation
…mapped owner column was not served by the driver Since the columnMap -> owner_id arm took mapped objects out of the phantom-anchor test, a plugin driver that ignores the map left every member write refused with no server log. The write gate now passes the pre-image row to the diagnostic, which warns once per object when a non-phantom federated row has no owner_id key. Verdicts are unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2eGmV67aXQuY2TJg7s
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2eGmV67aXQuY2TJg7s
📓 Docs Drift CheckThis PR changes 1 package(s): ⛔ 2 release-owned page(s) name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 11 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin ebdd7f0432b1f637b3c95be92127e272a90f7d98 && git checkout ebdd7f0432b1f637b3c95be92127e272a90f7d98
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin d7625ea4500aa244c792d55b5d7668c80dbc10fe 41cbab7ca8dd5fff1bef5ea38f186b9877b56e6f && git checkout -B drift-repro d7625ea4500aa244c792d55b5d7668c80dbc10fe && git merge --no-ff 41cbab7ca8dd5fff1bef5ea38f186b9877b56e6f
node scripts/docs-audit/affected-docs.mjs --json d7625ea4500aa244c792d55b5d7668c80dbc10fe
|
|
epic:#27261#1 · marchtian · session_017ihL2c5z3q4h8inrn5kwqV 维护者速读
席位意见:ACCEPT。 席位核对
|
Requested by 田騏 · project thread
Fixes #27662
Clause-②: no
Metadata-protocol: none
维护者速读
columnMap把远端列映到owner_id、但驱动没把这列返回时,成员写入被拒的同时,服务器重新打出一行 warn(每个对象一次),点名「驱动没有返回映射的 owner 列」。privateexternal object whose driver servesowner_idwithout declaring it infieldsgives every member every row —hasPhantomOwnerAnchorreadsfieldsonly, so the read filter goes unscoped (epic #27261, found by #27332's dev) #27425 把这种映射算作已证 owner 后,[裁定确认] #8119 的裁定是 A(什么都不做)还是 C(保持 deny + 加诊断)?联邦 phantom 锚上的写门拒绝是完全静默的,且现已知在每个方言上都如此 #8418 的诊断不再触发,运维只看到一个 403,没有任何日志。packages/plugins/plugin-sharing/src/sharing-service.ts的notePhantomAnchorWriteDeny(新分支按「行里没有owner_id键」判定);同文件新常量UNSERVED_OWNER_WRITE_DENY_NOTICE;测试文件末尾的[#27662]块。pnpm --filter @objectstack/plugin-sharing exec vitest run src/federated-phantom-owner-scoping.test.ts,预期 57 个用例全绿,其中[#27662]块 6 个。What changes
matchesOwnerScopepasses the pre-image row it already read to the [裁定确认] #8119 的裁定是 A(什么都不做)还是 C(保持 deny + 加诊断)?联邦 phantom 锚上的写门拒绝是完全静默的,且现已知在每个方言上都如此 #8418 diagnostic. No new query.notePhantomAnchorWriteDenykeeps its phantom-anchor branch byte-for-byte. A second branch fires when the object is federated, is not phantom-anchored, and the row came back with noowner_idkey at all. It logs the new exportedUNSERVED_OWNER_WRITE_DENY_NOTICEwith the same payload (object,ownerField,userId) under the same once-per-object latch.hasPhantomOwnerAnchorandfederated-phantom-anchors.tsare not touched: the new branch reuses the already-exportedisFederatedObjectand reads nocolumnMapitself, so it adds no fourth reader to the set spec: resolveInjectedColumnProvenance does not know the external.columnMap → owner_id arm plugin-sharing honours since #27425, so the #7858 convergence row and the two columnMap readers diverge (epic #27261) #27661 is consolidating.Tests
New
[#27662]block infederated-phantom-owner-scoping.test.ts:orgdepth, and logs exactly one unserved-owner notice (never the phantom one);external.columnMap;Acceptance notes
owner_idwhen its driver returns rows without that key (for example the SQL driver discarding a projection that names a column the remote table lacks). That is the same operator-facing fault, and the message says "maps (external.columnMap) or declares". The card's declared-owner control (owner present) is silent, as pinned.notePhantomAnchorWriteDenyname to keep the diff small; its doc comment now names both notices.Verification
Readings for head
41cbab7care in the os-dev-report on the card.Generated by Claude Code