Repository navigation
fix(app-shell): count the record discussion reaction read's batches against the row budget as one read - #39342
Conversation
…gainst the row budget as one read Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK Co-authored-by: Claude <noreply@anthropic.com>
… client's 100-comment batch; changeset Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK L1: ACCEPT · PR #39342 at head Head read back through Reads: card #39313 body and its comments (triage 7376938471 and 7377848037, claim 7378573816, os-dev-report 7380601301), the PR body, the net diff against main (4 files: Equivalence (read and measured). The door's list plan ( Ordering. The walk runs after Failure mapping. In the catch, Cost. One extra one-row GET, only when 2 or more batches answered rows, i.e. threads over 100 comments with reactions in more than one batch. A single answering batch sends none; this is pinned by the second test, which expects 0 Tests, ablation and positive controls (my runs, in a scratch worktree at
Scope and changeset. The files are inside the claim's file surface. Changeset
Fixes vs Part of. Gates at Out of scope, Observation C (dev's out_of_scope_findings): confirmed by reading Seat at landing (2026-12-03T14:26Z): every check at |
Fixes #39313
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
On a deployment with
OS_DATA_QUERY_ROW_BUDGET, the record page payload (readReactionsinpackages/rest/src/record-page-routes.ts) counts every id chunk's reaction rows against the budget, so the thread's reactions together past the budget refuse thereactionspart. The client's direct read (readCommentReactionRowsinui/packages/app-shell/src/views/useRecordDiscussion.ts, used by the list-page comments column, the phone comments page and every comment read the payload does not serve) reads the thread in batches ofREACTION_READ_COMMENT_IDS(100) comment ids, in parallel, each batch its own query, so the door judged each batch alone. A thread over 100 comments whose reactions together were past the budget, with no batch past it, showed its reactions there and none on the record page.Premise re-read on
mainat 6b2e596 (includes #39308 and #39309): holds as the card states.The fix keeps the batches parallel and adds the one thing the door could not see: when more than one batch answered rows, the client asks the door its own budget rule of the whole walk, with one read of the last answering batch at
$skip= (rows read together) minus 1 and$top= 1. The door judges$skipplus$topagainst the budget before it runs anything (planQueryReadWindow), so it refuses exactly when the rows together are past the budget, the same rulebudgetRefusalOfWalkapplies server side. The client never learns or infers the budget number; the door'sQUERY_ROW_BUDGET_EXCEEDEDrejects the read, as a page past the budget already does, and the caller shows the comments without reactions, as the payload's refused part does. A400that is not the budget's leaves the rows standing (as a later page's does inreadEveryPage); a failure or a refusal rejects. Cost: one extra one-row GET, only for a thread whose reactions span more than one 100-comment batch. No new client or server surface, and the data door's budget means the same for every other consumer.record-page-routes.tsis unchanged: the payload already applies the rule; its test file gains the twin table.Files edited:
ui/packages/app-shell/src/views/useRecordDiscussion.tsui/packages/app-shell/src/views/useRecordDiscussion.test.tsxpackages/rest/src/record-page-routes.test.ts.changeset/39313-reaction-read-budget-one-walk.md(@object-ui/app-shellpatch)Read first:
readCommentReactionRowsinuseRecordDiscussion.ts: the walk read and its catch (which verdicts reject, which leave rows standing). Highest risk: the$skiparithmetic (rows read together minus 1,$top1).#39313describe inuseRecordDiscussion.test.tsx: the door double filters bycomment_id$inand applies the page/budget rule per query.[#39313]describe inrecord-page-routes.test.ts: the same case table against the payload.Tests
Both doors are pinned with one case table (150 comments, so two client batches; reactions on comment 1 and comment 101; budget 10): rows together past the budget with no batch past it (6 + 6), with and without a page size of 4, are declined on both; rows that fit exactly (5 + 5, and 6 + 4 paged) are shown on both; one batch past the budget (11 + 0, 0 + 11 paged) is declined on both. One more client test pins the walk read's window (
[11, 1]for 6 + 6) and that a thread whose reactions sit in one batch sends none.Local runs at fb3b009
pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/useRecordDiscussion.test.tsx packages/app-shell/src/views/ObjectView.phoneCommentsPage-39086.test.tsx: 2 files, 40 passed.RecordDetailView.*suites that readsys_comment_reaction: 7 files, 71 passed.pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/record-page-routes.test.ts: 60 passed (the 6 new[#39313]cases confirmed by-t 39313 --reporter=verbose: 6 passed, 54 skipped).@object-ui/app-shelltype-check(src +tsconfig.test.json): exit 0, after building its dependency closure.@objectstack/resttypecheck(tsc + check:test-typecheck): exit 0.scripts/ablation-replace.mjs, anchorif (answering.length > 1) {replaced byif (answering.length > 1 && false) {, landed x1 to x0, blob 6a0a0938 to b8619467): 3 failed, 21 passed; the two "rows together past the budget, no batch past it" cases and the walk-window test went red. Restored: blob equals HEAD,git diff HEADempty.Acceptance notes
computeReactionVisibilityFilterinpackages/plugins/plugin-audit/src/comment-access-hooks.ts,READ_SCAN_LIMIT= 2,000) reads at most 2,000 reaction rows of the read'swherein the caller's order, under system context, and narrows the read tocomment_idin the comments those rows name. A comment none of whose reactions falls in those first 2,000 rows is filtered out, fail closed, with one warn line. Its own comment says a comment feed "never hits this", but one 100-comment client batch or one 500-id payload chunk with more than 2,000 reaction rows does, and the two doors hit it at different sizes. It bites only with no budget or a budget over 2,000. Not changed here (outside this card's file surface); reported to the seat.Verification
Two-minute check:
pnpm --dir ui exec vitest run packages/app-shell/src/views/useRecordDiscussion.test.tsx -t 'past one reaction batch', expect 7 passed. Gates:node scripts/pm/dispatch-gates.mjs --ranover the 68 derived commands at fb3b009: 66 run with exit 0, 2 NOT MEASURED (exit 3, prerequisite not met:check-plugin-teardown-shape.mjs --self-testneeds an unshallowed clone;check:dual-build-cjs-loadsneeds every package'sdist).overlap-check.mjs: clean against origin/main 170f9f8, 0 PR heads. Every other family is CI's.Generated by Claude Code