-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readable stream change from v10 to v11 with for-await loop #26373
Comments
The code is working as expected. You are emitting “close” too early. “close” means that there is nothing more to read, and the iteration ends. Note that it is emitted automatically when there is nothing else to read. In other terms, do not emit close and it will all work. |
@mcollina yes i know reason is 'close' event. I specifically wrote it is problem in pg-query-stream. |
The problem is that it is a bug in pg-query-stream, not here. It should not be emitting that event there. From https://nodejs.org/api/stream.html#stream_event_close_1:
Note that the behavior of the iterator is actually correct according to this docs. You should open an issue on pg-query-stream about the close event. Note that will also break pump and |
Hi.
We noticed that our app breaking v11 of nodejs. We located this to pg-query-stream. Simplified test case:
Results:
and
I tried to search for breaking changes and issues but did not noticed anythign similar. Also i understand that asyncIterator is experimenal, but this looks like some sort of bug.
I am thinking this could be a bug because stream already pushed items and after this it emits close event (this is from pg-query-stream), but in v11 iteration stops right after close event, ignoring already pushed items.
The text was updated successfully, but these errors were encountered: