Repository navigation
fix(console): open a phone list-page comment thread past the first page of its record discussion - #39252
Draft
objectstack-fleet[bot] wants to merge 4 commits into
Draft
fix(console): open a phone list-page comment thread past the first page of its record discussion#39252objectstack-fleet[bot] wants to merge 4 commits into
objectstack-fleet[bot] wants to merge 4 commits into
Conversation
…; judge a phone thread gone by its root Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK Co-authored-by: Claude <noreply@anthropic.com>
… discussion Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK Co-authored-by: Claude <noreply@anthropic.com>
…ad is not reported gone Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK Co-authored-by: Claude <noreply@anthropic.com>
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #39195
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Part of #39077, the list-page comments topic; that topic stays open after this PR.
On a deployment with a data page size (
OS_DATA_DEFAULT_PAGE_SIZE/OS_DATA_MAX_PAGE_SIZE), a list read that names nolimitanswers the first page andhasMore: true(packages/types/src/query-read-limits.ts, "refuse, never clamp"). The record discussion's comment read inuseRecordDiscussion.tsnamed no limit and never looked athasMore, so it held only the oldest page. A thread whose top-level comment sat past that page was missing fromuseRecordComments().threads, and the phone list page'sThreadGonesent the reader back to the cards.useRecordDiscussion.ts: the non-payload comment read is nowreadRecordComments: while the answer sayshasMore, it reads the next page with$top= the first page's length (so never over the deployment's maximum) and$skip= the rows read so far. A later page that fails (5xx, network) or is refused (401/403) fails the read, as the first page's would. A later page refused with a400(the row budget, a refusal no retry changes) ends paging and the pages read stand. With no page size the first answer is the whole discussion, so nothing changes there: one request, as before. The record page's payload path (served) is untouched.objectViewCommentsPage.tsx:ThreadGoneno longer decides "gone" from absence in the discussion. When the thread is absent from the read discussion, it reads the thread's top-level comment by id (dataSource.findOne('sys_comment', id)). Gone means no row, or a row that is not a top-level comment of this record's discussion. A refused or failed root read says nothing, so the page stays.The record page (when it reads the discussion itself) and the desktop list column use the same
readComments, so they now show the newest comments past the first page too. That is the same fix, in the same file.Read first (riskiest first):
useRecordDiscussion.ts,readRecordComments: the paging loop and how a later-page error is handled.objectViewCommentsPage.tsx,ThreadGoneandisThreadRoot: when a thread counts as gone.objectstack#39195describe block inObjectView.phoneCommentsPage-39086.test.tsx: the paging mock (page cap, row budget).Tests
New describe block
objectstack#39195 — a thread past the first page of its record discussioninObjectView.phoneCommentsPage-39086.test.tsx. Its mock data source answerssys_commentlike a capped deployment: with no$topit returns the first page, otherwise$skip/$top, withhasMore. It refuses a$topover the cap, refuses a walk past an optional row budget with a 400, andfindOnereturns the row by id ornull.[none],[skip 2, top 2],[skip 4, top 2];sys_commentfor that id;The existing case
falls back to the cards when the thread is gone from its recordstill passes unchanged.Test runs (head a020f36, from ui/, under the shared verify lock)
vitest run ObjectView.phoneCommentsPage-39086.test.tsx useRecordDiscussion.test.tsx:Test Files 2 passed (2),Tests 20 passed (20), VERDICT command-exit 0.sys_comment(record page, desktop list column, feed tests):Test Files 30 passed (30),Tests 449 passed (449), VERDICT command-exit 0 (run at the code-identical commit before the changeset commit).pnpm --filter @object-ui/app-shell type-check(bothtsc --noEmitandtsc -p tsconfig.test.json): VERDICT command-exit 0.Ablation (each leg via scripts/ablation-replace.mjs, restored to the HEAD blob, git diff HEAD empty)
find):opens a thread that starts past the first page, with its replies, and stays on itturns red,Tests 1 failed | 14 passed (15). The other new cases stay green, because they are about the gone check, not about paging.ThreadGonecalls back on absence alone):does not report gone a thread the deployment's row budget keeps out of the readturns red,Tests 1 failed | 14 passed (15).Acceptance notes
recordPageComments,served) is outside this change. I did not measure whether the server caps the discussion in the page payload.CommentsPagewith the thread not in its rows) instead of the thread. Pinned as "not gone". Showing the thread itself there would need a per-thread read, which this PR does not add.readCommentReactionRows(same file) sends each page of 100 comment ids with no$topand ignoreshasMore. Under a page cap smaller than those comments' reaction rows, it shows fewer reactions than are stored. It goes to the seat for the family's card.Verification
Two-minute check: from
ui/, runpnpm exec vitest run packages/app-shell/src/views/ObjectView.phoneCommentsPage-39086.test.tsx. Expected: 15 tests pass, including the four in theobjectstack#39195block.Local gates (head a020f36)
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 38 commands for this diff. All 38 ran, pluspnpm check:changeset-fixed(its roster is under.changeset/). Every one exited 0.dispatch-gates --ranwith exit codes recorded:38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3).node scripts/pm/overlap-check.mjs:origin/main: merges cleanly, 0 open PR heads share a file,VERDICT clean exit 0.test:repo, the type-check lanes and the full farm run in CI; I did not re-run them here.Generated by Claude Code