Repository navigation
test(plugin-approvals): seed the past-500-decided stranded-scan cases in batches, not 1200 serial inserts - #38235
Merged
Conversation
…s, not 1200 serial inserts The "older strand outside the newest window" case seeded 1201 rows with one engine insert each; that seeding was ~90% of the case's ~1 s locally and 5.8-13 s on loaded merge-queue runners, past the 5 s test default, so it ejected unrelated PRs from the queue. The rows now go through the engine's own array insert, 200 rows per batch (SQLite refuses a multi-row INSERT past its 500-term compound SELECT). Rows, order and every assertion are unchanged; the 600-row case additionally asserts all 601 rows are read. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgVv7fqmna3sqqbjzf2
Contributor
📓 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): |
2 tasks
Contributor
Author
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head 19eeab6 · card #38223 · area s2-ai · 2026-11-28T09:47ZL1 checklist (no review face on this file list: this record is the review of record)
Tier: S. Landing: ready and auto-merge in this stroke. |
This was referenced Nov 28, 2026
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.
Requested by Sales · project thread
Fixes #38223
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
packages/plugins/plugin-approvals/src/stranded-request-inspection.test.ts, the#37808 — past 500 decided requestsblock only:insertAllseeds through the engine's own array insert,engine.insert('sys_approval_request', rows[], …), in batches ofSEED_BATCH = 200rows, instead of oneengine.insertper row. Same rows, same insertion order, sameisSystemcontext, same realObjectQLoverSqlDriver(better-sqlite3, in-memory).too many terms in compound SELECT(its default 500-term compound limit; knex emits a multi-row insert as a compound SELECT there). A comment besideinsertAllsays why the batch exists and why it is 200.out.scanned === 601: the newest window (ids 102–601) plus the first walk page (ids 1–500) read every seeded row, so a short batch write cannot pass it silently. This only adds an assertion; none is removed or loosened.No timeout was raised, nothing is skipped, and the scale (600 and 1201 decided requests, 500 per window, 3 + 3 sweeps) is unchanged.
Why
The card's evidence (comment 7236773117): the case took about 1 s locally and 5.8 to 13 s on queue runners, against the 5000 ms default. Measured here, on the case "an older strand outside the newest window is reached by the cursor":
The 600-row case went from about 570 ms to 100–170 ms. The whole file's 39 tests are unchanged and green.
Verification
Ablation (the cases still detect the bug they pin): with
inspectStrandedRequestsreverted to the pre-#37808 read (noorderByon the newest window, no id cursor on the walk), the 600-row and 1201-row cases both fail under the new seeding, exactly as they fail under the old one; CONTROL passes in both. Restored, 3/3.runs
Head 19eeab6.
pnpm turbo run build --filter='@objectstack/plugin-approvals^...': exit 0.npx vitest run src/stranded-request-inspection.test.ts(in the package), three times: 39/39 passed each time.npx vitest run(whole package): 131 files, 1979 tests passed.pnpm typecheck(package, includescheck:test-typecheck): exit 0.node scripts/pm/dispatch-gates.mjs --commands --changed: 54 derived; 51 exit 0; 3 exit 3 (PREREQUISITE NOT MET), so NOT MEASURED locally and left to CI:node scripts/check-plugin-teardown-shape.mjs --self-test(its fixture commit is out of this shallow clone),pnpm check:dual-build-cjs-loadsandpnpm check:i18n(both read every package'sdist/; only this package's closure is built here).--ranreconcile: 54 accounted, 0 UNRUN.npx eslinton the changed file: exit 0.Acceptance notes
ObjectQLarray insert of more than about 500 rows on SQLite throwstoo many terms in compound SELECTfromSqlDriver.bulkCreate, which does not chunk. Reported to the seat as a follow-up candidate.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintwas not run locally; CI runs it).main, one pull request. (branchclaude/project-thread-4xkl1nis the harness-assigned name)skip-changeset).packages/spectouched: no.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgVv7fqmna3sqqbjzf2