325: MSSQL: stream runner with row cap, cancel and timeout #349
No reviewers
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills!349
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-325/mssql-stream-runner-with-row-cap-cancel-and-timeou"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
325: MSSQL: stream runner with row cap, cancel and timeout
Implements 325.
Generated in 1m 00s.
Review findings
Review Findings — 325
Summary
I fixed all four findings. Post-truncation errors now resolve only when they look like a cancellation (
ECANCELor a message matching/cancel/i), and any other error rejects.maxRowsandtimeoutMsare validated as positive integers and reject withRangeError. The JSDoc now documents the multi-result-set merge. The timeout test now usesmock.timers.node --test extensions/mssql/runner.test.tspasses all 14 tests. The repo has no build or lint script, so neither gate ran. One part of the first finding is not covered: a timer firing after truncation still resolves as truncated. No error is involved there, because the cancel was already sent, so I left that behaviour as it was.Critical
High
Medium
erroris treated as the expected cancel error and resolved as a truncated success. A genuine failure such as a connection drop is therefore reported as a normal truncated result. The same applies at line 89 when the timer fires after truncation. Suggested fix: whentruncatedis true, resolve only if the error looks like a cancellation (for exampleerr.code === "ECANCEL"or a message matching/cancel/i). Otherwise reject. Add a test for a non-cancel error after truncation.Low
maxRowsandtimeoutMsare not validated. AmaxRowsof 0 or a negative value truncates on the first row. AtimeoutMsthat is NaN, 0 or negative fires the timer almost immediately. Suggested fix: throw aRangeError(or reject) unless both values are positive finite integers, and add tests.rowevents don't carry recordset boundaries. Suggested fix: document this in the JSDoc, or handle therecordsetevent if multi-statement batches are allowed through the guard.mock.timersfromnode:test.