node-postgres
node-postgres copied to clipboard
fix(pg-query-stream): invoke `this.callback` on cursor end/error
Closes #2013
This issue was caused by two things:
- the
Clientwasn't using thecallbackargument thatPool#querypasses with theQueryStreamsubmittable - the
QueryStreamwasn't attaching end/error listeners to itscursor, which it needs for calling itscallback
Thanks for doing this! Can you include a test to reproduce the issue / prove its fixed? Without tests I am unlikely to merge PRs as they become a future bug waiting to re-occur! 😄
I think pg-copy-streams may suffer from the same issue, and am happy to provide a failure case/ test.
@peterp I believe you can send a PR to my fork and it'll show up here when I merge
@aleclarson I'm sorry; I'm not going to find enough time to write this.
I'm sorry; I'm not going to find enough time to write this.
While I greatly appreciate the work in fixing this, the PR will remain unmerged until a test case is submitted. I can't merge untested code as it becomes a forever maintenance burden for me in the future with no way to check for expected behavior.
@aleclarson Can you update your repo to latest. I maybe able to write the tests that we needed for this
@ashmit-coder 👍
@aleclarson I let CI run on this PR so it should letcha know if tests pass. 😄