This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(console): tombstone a deleted record reference in the approvals inbox, never the raw record id - #8634
Merged
Conversation
…nbox When an approval's record is deleted the platform voids the still-pending requests and stamps the cause on the row (status `cancelled` plus `cancel_reason` `record_deleted`). The console read neither: the row fell back to `formatIdentity(record_id)` and showed an opaque id where the business identifier used to be, and still offered a link into a page that no longer exists. The desktop row, the mobile card and the request drawer now render a tombstone instead, drop the link, and move the payload snapshot's business identifier to the meta line so the audit row still says which record the approval was about. The `cancelled` status badge gained a label too, which was rendering the raw wire token. The copy is the platform's own on both paths: the localized `cancel_reason` option label when the server's translation bundle has loaded, and the authored English from `@objectstack/spec` when it has not. No second string is authored here, and the reason union is imported rather than re-spelled. Terminal `approved` / `rejected` rows are deliberately untouched. They were never cancelled, so they carry no cause, and the read path fuses "deleted" with "hidden from this viewer" on purpose (existence non-disclosure) — nothing on the wire separates them. Rendering a tombstone off a failed lookup would report a deletion to a viewer whose only problem is permissions, which is a worse claim than the id it replaces. Measurement and options recorded separately. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
os-justin
marked this pull request as ready for review
September 8, 2026 18:44
os-justin
enabled auto-merge
September 8, 2026 18:45
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #7108
Implements the presentation half of the maintainer ruling of 2026-08-31 (总监席第 5 场决裁批 #5), point 2, quoted in the language it was ruled in:
What was broken
When an approval's underlying record is deleted,
@objectstack/plugin-approvalsvoids the still-pendingrequests and stamps the cause on the row —status: 'cancelled'pluscancel_reason: 'record_deleted'(objectstack-ai/objectstack#13568, already shipped). The console read neither field. The row fell through toformatIdentity(record_id)and showed an opaque id where the business identifier used to be, and still offered a link into a page that no longer exists.What this changes
cancelledstatus badge gained a label. [finding] 删除记录后,它的审批单仍留在审批收件箱:pending 与 approved 两种都留,记录引用退化为原始 id objectstack#13568 added the state; with no case for it the badge rendered the raw wire tokencancelled. Included deliberately as a bounded in-place change: it is the same defect class (a raw machine value where business copy belongs), on the very row this card creates, and its shape is pinned upstream.The copy is upstream's, on both paths
⛔ No English string is authored in this repo.
useDeadRecordReferenceLabelresolves the platform's own localizedcancel_reasonoption label (shipped in en / ja-JP / es-ES / zh-CN byplugin-approvals, served at the i18n translations endpoint, landed bytransformSpecTranslationsunderfieldOptions.sys_approval_request.cancel_reason.record_deleted), and falls back toAPPROVAL_CANCEL_REASON_LABELS.record_deletedfrom@objectstack/spec— the very text theenbundle is generated from. The reason union is imported rather than re-spelled, for the same reason.An ablation leg pins that: replacing the contract label with a hand-written objectui string reds three cases.
The card's own stop condition was: if "deleted" and "not visible" cannot be told apart from what the API returns, report that as a finding rather than guessing a rendering. They cannot. Measured against
objectstackat6c546ab9and@objectstack/spec@17.3.0as installed here:cancelForDeletedRecord'swherenamesstatus: 'pending'; its own docstring says "Terminal rows are untouched … history is kept." So anapproved/rejectedrow about a deleted record carries nocancel_reasonat all — the spec declares that field "present only on rows whose status iscancelled".record_titleis no proxy:enrichRowsresolves it under the SYSTEM context and falls back to the payload snapshot, so the client receives one string either way and cannot see which branch produced it.id in (…)list read as the viewer, and a deleted record and an RLS-filtered one are both simply absent.packages/runtime/src/action-execution.ts): "the read path collapses 'filtered out by RLS' and 'this id names nothing' on purpose (existence non-disclosure) … inventing a 403 for the pair would answer a question the platform declines to answer everywhere else."⇒ A terminal row about a deleted record still shows the opaque id. Rendering a tombstone from a failed lookup would report a deletion to a viewer whose only problem is permissions — objectstack-ai/objectstack#7345's case, where the record exists and a visibility gate hides it — asserting something that may not have happened. That is a worse claim than the id it would replace, so it is not made. The two causes stay distinct in both the code and the copy, as the ruling requires; objectstack-ai/objectstack#7345 is a different cause and is not addressed here.
The measurement, the three options and a recommendation are recorded in objectui#8631 for the maintainer to decide.
Pins, and every one of them observed RED
apps/console/src/pages/system/ApprovalsInboxPage.tombstone.test.tsx— 9 cases. Four ablation legs, each proved to reach disk before the run and each restored by blob-hash comparison against HEAD afterwards:false(fix removed)true(the caricature: every reference tombstoned)The non-deletion-failure fixture is the one worth reading:
rec_hiddenand both deleted ids are all absent from the probe's answer, exactly as the platform fuses them, and only the rows the server markedrecord_deletedare tombstoned.Verification
pnpm exec vitest run --project @object-ui/console— 91 files / 1081 tests passed, at4835a7c3d(the final commit).pnpm --filter @object-ui/console run type-check— exit 0, on a built dependency closure.tsc --listFilesconfirms both new files are in the 3538-file program, so the check is not vacuous.ApprovalsInboxPage.recordLink.test.tsx.node scripts/check-changeset-presence.mjs—✅ 4 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s).check-changeset-no-major.mjs:✅ No changeset declares a major bump.node scripts/check-control-bytes.mjs— OK, 6826 files.eslinton the four touched files — exit 0, no new warnings.node scripts/check-governed-queue-guard.mjs --test—✅ NOT GOVERNED.Draft, and no auto-merge armed.
Generated by Claude Code