Repository navigation
fix(errors): chunk the error tick's bulk statements under the bind-parameter cap - #1271
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Oct 6, 2026 in 4m 12s
Confidence 4/5 · No issues found
🟢 Confidence 4/5 · likely safe to merge
The chunked writes rely on Effect.forEach running raw drizzle query values, which is what the new 3,100-row test verifies end to end; otherwise the transformation is mechanical.
quality 100/100 · no findings · tests covered · risk medium
persistErrorTickWindow now runs every bulk read and write in 500-row chunks inside the same transaction, so a window past the 32,767 bind-parameter cap commits and the cursor advances instead of failing forever. The transformation is mechanical and I found no defect.
inChunks/chunkswrap each bulk statement inpersistErrorTickWindow(candidate, issue, state, incident, event, outbox writes)- Duplicate conflict targets stay impossible per statement because
mergeScanRowsdeduplicates by fingerprint first incidentsResolvednow counts distinct flipped ids from the chunked RETURNING
What was checked
- Parameter budget per chunked statement: widest is the 26-column issue upsert at 13,000 params (
error-tick-persistence.ts:531) - Every statement still filters
OrgId, including the chunked state-clear and stale-issue read (error-tick-persistence.ts:891) - Raw SQL in the incident/state refresh is unchanged apart from indentation (
git diff -won the file)
0b92935 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading