Skip to content

fix(gantt): a gantt opens on a host with a maximum page size — walk to the row ceiling in steps instead of one 10,001-row read - #36665

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-s188zm
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-s188zm

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #36663
Clause-②: no
Metadata-protocol: none

What changes

  • ui/packages/plugin-gantt/src/ganttRowWalk.ts (new, not exported from the package index): fetchGanttRows reads the gantt's filtered result set up to GANTT_ROW_CEILING + the probe row in steps of GANTT_FETCH_STEP = nonGridRowCeilingQuery().$top (2,001), the one read the calendar, map, tree and timesheet already send. The first read is the authored query with $top = the step; when it settles the set (short, or an adapter that ignored $top) it is returned as is, envelope included, so a set that fits is still one read with the authored $orderby untouched. A FULL first read means more rows exist: the set is then walked from the top under a unique order, the authored $orderby with id appended as the tie-breaker in the last key's direction (withIdTieBreak; asc when nothing was authored), and rows are kept once by id/_id. $skip moves by the rows that came back; the walk stops at the first short answer or one row past the ceiling and answers { data, total? }. It stops asking once a newer reload owns the screen.
  • ObjectGantt's reload calls it in place of the single find with ...nonGridRowCeilingQuery(GANTT_ROW_CEILING). Everything else in the query ($filter, $orderby, $expand, $search) and the cut (applyNonGridRowCeiling(result, GANTT_ROW_CEILING), NonGridRowCeilingNote) are unchanged.
  • @object-ui/core non-grid-row-ceiling.ts: docblocks only. GANTT_ROW_CEILING now says it is a stop condition, not a request size; nonGridRowCeilingQuery no longer says the gantt passes its ceiling to it.
  • Tests: the harness adapter honours $skip, and can refuse a $top over a maximum page size the way the server does. New block "a host with a maximum page size of 5,000": an empty object draws (one read, no refusal), 6,234 rows all draw with every $top at or under 5,000, and past 10,000 the ceiling and its note still show. Existing $top pins move from 10,001 to the step; the truncation case now pins the walk ($top sums to 10,001, each $skip is the rows before it, each carries $orderby: { id: 'asc' }). New ganttRowWalk.test.ts (7 cases): one read answered as is with the authored order, no read over the step, the tie-break order, a row kept once when an unstable adapter repeats it across a step boundary, and the stop once a newer reload owns the screen.

Why

Live hosted customer (HotCRM PSA crm_project_task, gantt view project_plan): the view shows only "Query parameter 'top' asks for 10001 rows; this deployment's maximum page size is 5000. The query was not run." The hosted plane sets OS_DATA_MAX_PAGE_SIZE=5000, and planQueryReadWindow refuses any limit over it before the driver runs, so the refusal depends on the $top asked for, not on the rows held: the maintainer confirmed that tenant's plan has no tasks at all. Every hosted gantt was unusable.

Deviation from the card's fix direction, stated: the card proposed one shared walk in @object-ui/core used by every non-grid view. Only the gantt asks one read for more than the others: calendar, map, tree and timesheet send 2,001, which the hosted cap accepts. So the walk is private to plugin-gantt and steps at that same 2,001. No new public export (Clause-② no), and the other four views are untouched. A deployment whose cap is below 2,001 still refuses all five views alike; that is a separate question for a follow-up, not this fix.

Paging order: the platform's drivers already append the id tie-breaker to a paged read (driver-query-in-memory.ts "Sort and paging"), but an adapter that does not would let offset steps over tied sort keys (a stage, a date) repeat one row and skip another, the finding raised on the sibling PR #36658. So the multi-step walk sends the unique order itself and dedupes by id. The first full read is re-read under that order rather than reused, which costs one extra read only for sets over 2,001 rows; it keeps every single-read case, and every existing $orderby pin, exactly as authored.

Verification

  • npx vitest run packages/plugin-gantt/ packages/core/src/utils (under ui/): 220 files passed, 1 skipped; 3,018 tests passed, 114 skipped (at 14353fe). After the tie-break change, packages/plugin-gantt/: 97 files passed, 1 skipped; 809 tests passed, 114 skipped.
  • Reverse check: with the first step set back to 10,001, all three "maximum page size of 5,000" cases fail (the refusal is drawn instead of the chart); restored, they pass. With the dedupe removed, "keeps a row once when tied keys move it across a step boundary" fails; restored, it passes.
  • pnpm type-check in ui/packages/plugin-gantt: clean. eslint on the touched files: 0 errors (existing warnings only).
  • Delivery: the reporting tenant is hosted, so the fix reaches it only after a framework release and the cloud repo's framework pin moves and deploys.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JQwxbaTVGEEt267uyT6ufm

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 23, 2026
…p each row once

A full first read is re-walked from the top with id appended to the
authored $orderby (last key's direction), and rows are kept once by id,
so offset steps over tied sort keys cannot repeat or drop a row on an
adapter that does not break ties itself. A set that fits one read is
still one read, as authored.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbaTVGEEt267uyT6ufm
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Re-run note · 2026-11-23T10:38Z: one re-run of the failed job in run 45157244491.

  • Signature: Live E2E UI (job 137633488565). e2e/live/master-detail.spec.ts:68 › "the status select offers only the state the server admits on create". Its first error is expect(getByRole('heading', { name: 'New Project + Tasks' })).toBeVisible(), which timed out at 5000 ms. 1 failed.
  • Why the seat judges it this PR's neighbour, not this PR:
    1. The failing spec drives the master-detail create form. This diff is the gantt's paged read (plugin-gantt) plus docblocks in @object-ui/core. Neither is on that form's path.
    2. The same job is green on main 9348f02b (completed 09:56Z).
    3. The first error is a wait that ran out (a heading not visible within 5 s), not a wrong value.
  • Rule: if this re-run goes red again, it is a real failure. The seat then files it with this signature and re-runs nothing more.

@github-actions github-actions Bot added the tests label Nov 23, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

客户在托管环境里打开甘特图,只看到一行报错:一次要 10001 条数据,超过了托管环境每次最多 5000 条的限制。现在甘特图改成分批读取(每批约 2000 条),最多仍显示 1 万条,超过时照旧提示。日历、地图、树形视图本来就在限制内,没动。
要客户那边生效,还要发一个平台新版本,再更新 cloud 用的平台版本并部署。
CI 全绿,非受管面,席位落地。
要你做的:无。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head c84c8fec · 2026-11-23T11:01Z

  • Shape: Fixes #36663. Changed files: ui/packages/plugin-gantt/src/{ganttRowWalk.ts,ObjectGantt.tsx} and its tests, plus docblocks in ui/packages/core/src/utils/non-grid-row-ceiling.ts. One changeset, patch, for @object-ui/plugin-gantt and @object-ui/core. Tier S, not governed. Clause-②: no holds: the walk is private, absent from the package index, and nothing is exported.
  • Deviation from the card, accepted: the card proposed a shared walk in @object-ui/core for every non-grid view. Only the gantt sends a read over the hosted cap. Calendar, map, tree and timesheet send 2,001, which the hosted 5,000 cap accepts. A private walk fixes the live symptom with no new public surface. A deployment whose cap is below 2,001 still refuses all five views alike. That is unchanged and not filed; it has no reported case.
  • Read:
    • fetchGanttRows asks $top = 2,001 (nonGridRowCeilingQuery().$top), then advances $skip by the rows returned.
    • It stops at the first short page, or one row past the 10,000 ceiling. That keeps applyNonGridRowCeiling's over-ceiling notice working.
    • A first answer that settles the read is returned unchanged; this is the common case. An adapter that ignores $top is sliced by the ceiling as before.
    • isCurrent stops a walk a newer reload has replaced.
    • A first read that settles the set is returned with the authored $orderby untouched, which keeps every existing $orderby pin.
    • A full first read starts a walk from the top under the authored keys plus id, in the last key's direction (asc if there are none).
    • Rows are kept once by id/_id, so tied keys that shift across a step boundary neither repeat nor drop a row. The drivers' own id tie-breaker (driver-sql paginationTieBreaker) backs this.
    • The first page is read again under that order, one extra read and only for sets above 2,001.
    • The one edited existing assertion (ObjectGantt.elementDataSource.test.tsx) now expects the first read's $top to be the step, not 10,001. That is the fix itself, not a loosening.
  • Evidence:
    • Tests: plugin-gantt + core utils 220 files / 3,018 tests green.
    • New ganttRowWalk.test.ts (7 cases): removing the dedupe reds "keeps a row once when tied keys move it across a step boundary". plugin-gantt 97 files / 809 tests at c84c8fec.
    • Ablation: the three new "maximum page size of 5,000" cases go red when the first step is put back at 10,001.
    • Type-check and lint clean.
  • Gates: 62 check-runs on c84c8fec: 47 success · 15 skipped · 0 failed. The earlier Live E2E UI red on 14353fe2 (master-detail heading wait, re-run note 7098265437; the re-run was refused because the head had moved) was superseded by this head and does not recur here. K = 1 first-parent commits behind main (< 15).
  • Landing: ready + auto-merge now. On merge Gantt view fails on every hosted tenant: it asks for 10001 rows in one query and the hosted 5000-row page cap refuses it ("Query parameter 'top' asks for 10001 rows") #36663 closes and the seat clears its label. Reaching the hosted tenant also needs a framework release, the cloud pin move and a deploy. That is the release lane's step, named here so it is not mistaken for done.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 11:01
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 3aa008d Nov 23, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-s188zm branch November 23, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants