Repository navigation
fix(app-shell): cut the record discussion read's last page at the row budget, decline a thread past it - #39308
Conversation
… budget, decline a thread past it Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK Co-authored-by: Claude <noreply@anthropic.com>
…ne on the phone comments page Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK Co-authored-by: Claude <noreply@anthropic.com>
…t cut Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-bill · os-bill · session_01Utp6Ca2yTZZiHWkyVgD2oK L1: ACCEPT (code and evidence) · PR #39308 at head 28e3191 ( Seat, 2026-12-03T11:48Z: conditions met. CI at What I read. The body of card #39296 and its comments: triage 7375009116, claim 7375083193, os-dev-report 7376601317 (2026-12-03T11:22Z). The PR body. The net diff against main dc4a2cd (4 files; Face. Shape, first line The halving probe against the door's contract.
Agreement with the payload on the card's cases. With page 3 and budget 7, both give 7; the test pins the reads [[–,–],[3,3],[6,3],[6,1]]. With budget 6, both give Surface. No guess and no new client or server surface: the PR only sends the Evidence.
Changeset sentences, checked against the diff and main:
PR body footer. Clause-②: no. No published accept-set change: the change is client-only, and the request and response shapes are untouched. No contract review is owed. Non-blocking, not filed. The client splits reaction reads into batches of 100 comment ids, and the row budget applies to each batch separately. The payload reads one |
Fixes #39296
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
On a deployment with both a data page size and
OS_DATA_QUERY_ROW_BUDGET, the client's direct discussion read (readEveryPage, used by the list-page comments column, the phone comments page and every comment read the record page payload does not serve) paged$top: pageSize, $skip: rows.lengthwith no last-page cut, and on a later page's400 QUERY_ROW_BUDGET_EXCEEDEDkept the pages read. The record page payload's read (readWholeStreaminpackages/rest/src/record-page-routes.ts) cuts its last page at the budget and answers a thread past it with the refusal. Premise re-read onmainat f808641: holds as the card states.The budget is not served to the client (the refusal envelope carries
codeandstatus; the number appears only in the message prose, which this change does not parse), so no new client/server surface is added. The refusal locates the budget instead, under the data door's own contract (refuse, never clamp: a page is refused exactly when$skip + $topis past the budget):ui/packages/app-shell/src/views/useRecordDiscussion.ts—readEveryPage: a later page the row budget declines is asked again with a smaller$top, halving between the largest$topanswered and the smallest refused (at most about log2 of the page size extra reads; a refused one never reaches the driver). That ends the last page at the budget. A thread that ends inside the cut page is read whole; one with rows past it (the cut page still answershasMore, or no row of the page fits) rethrows the server's own refusal, which the caller recordsdeclined(the existing state from fix(app-shell): a record discussion the row budget declines is not shown as empty #39287, drawn with the existing "We couldn't load the comments for this record." note, no new wording). Any other later400keeps today's behaviour. TheFeedReadVerdictdoc fordeclinedgains the paged case.readCommentReactionRows) goes through the samereadEveryPage, so it follows the same rule: reactions that fit are all shown; reactions past the budget throw, and the comments show without reactions, as the payload's refused reaction read (reactionRowsnull) does.ui/packages/app-shell/src/views/useRecordDiscussion.test.tsx— a newdescribeover a double of the data door's read limits (page size, budget; refuse never clamp).ui/packages/app-shell/src/views/ObjectView.phoneCommentsPage-39086.test.tsx— the existing case "does not report gone a thread the deployment's row budget keeps out of the read" pinned the short-list consequence (the read kept two rows and the page then askedfindOnefor the thread). It now pins the aligned behaviour: the declined note shows, the thread is not judged gone (findOnenot called), the page stays on the thread..changeset/39296-discussion-read-row-budget-cut.md—@object-ui/app-shellpatch.Read first, by risk: (1)
readEveryPageinuseRecordDiscussion.ts— the probe loop and the twothrow refusalexits; (2) the newdescribe"a paged discussion against the row budget" inuseRecordDiscussion.test.tsx, whose door double is the contract the probe relies on; (3) the edited phone comments page case.Tests
describe"useRecordDiscussion — a paged discussion against the row budget": page 3 / budget 7 / 7 comments gives all 7 and pins the reads[[undefined, undefined], [3, 3], [6, 3], [6, 1]]; page 3 / budget 6 / 7 comments givesdeclinedand no rows; page 3 / budget 8 / 10 comments givesdeclined; page 2 / budget 5 / 5 reactions shows all 5; 6 reactions shows the comment without reactions and pins the reads[[undefined, undefined], [2, 2], [4, 2], [4, 1]].scripts/ablation-replace.mjs, committed first, restored to HEAD): mutating the later-page branch back to "break ondeclined" turns all 5 new cases red (6 of 7 comments;undefinedinstead ofdeclinedtwice;[4]instead of[5]reactions; reaction reads stop at 3); restore proven (blob == HEAD,git diff HEADempty).ui/test file that reads the discussion (42 files) and@object-ui/app-shelltype-checkare green on the tree of 28e3191 (itsui/files byte-identical to the runs; the last commit adds only the changeset).Test and ablation readings
Acceptance notes
readWholeStream, unchanged here.400still ends the paging with the pages read standing (pre-existing, not the budget's case, not reached by any door this change knows of).Verification
Two minutes:
pnpm --dir ui exec vitest run packages/app-shell/src/views/useRecordDiscussion.test.tsxfrom the repo root (after building@objectstack/specand the@objectstackpackagesui/imports) — expect17 passed, including the five cases of "a paged discussion against the row budget".Local gates (dispatch-gates
--commands, 39 derived): 36 run green, 3 NOT MEASURED (check-comment-mask-corpus,check:query-options-erasure,check:type-check-debttimed out on a shared box; CI runs them);--ranreconciliation: 39 accounted, 0 unrun.overlap-check: merges cleanly withorigin/maindc4a2cd.Generated by Claude Code