PDGGK opened a new pull request, #18:
URL: https://github.com/apache/iotdb-client-nodejs/pull/18
### Problem
`executeConcurrent(..., { stopOnError: true })` returns `successCount:
items.length - errors.length`. When `stopOnError` trips, the worker loop stops
and the remaining items are never attempted — they are neither successes nor
failures, but the formula counts them all as successes (e.g. concurrency 1,
first item throws → 0 operations complete, 1 error, but `successCount === 9`).
A caller trusting `successCount` believes 9 operations succeeded when 9 were
never attempted.
### Fix
Return `completedCount`, which is incremented only after an operation
resolves successfully. For the non-stopOnError paths `completedCount ===
items.length - errors.length`, so existing behavior is unchanged; only the
stop-on-error case is corrected.
### Tests
Added a regression case asserting `successCount === 0` when the first item
fails with `stopOnError`. Full `tests/unit` suite green (155 tests).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]