Skip to content
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

await getReader() #1103

Closed
wants to merge 1 commit into from
Closed

await getReader() #1103

wants to merge 1 commit into from

Conversation

drzraf
Copy link

@drzraf drzraf commented May 29, 2020

From experiments, getReader() may not be immediately ready (at least in case a lot of input data is to be compression).
In these case, the first await reader.read() / readBytes() would return undefined unless we explicitely waited for the reader.

From experiments, getReader() may not be immediately ready (at least in case a lot of input data is to be compression).
In these case, the first `await reader.read() / readBytes()` would return undefined unless we explicitely waited for the reader.
@twiss
Copy link
Member

twiss commented May 29, 2020

Ehm, that's really strange. Do you have a code example of this happening?

In any case, getReader doesn't return a Promise, so it shouldn't need await - if it does, it's broken and should probably be fixed somewhere else.

@drzraf
Copy link
Author

drzraf commented May 30, 2020

Sorry, the origin of my problem was obviously distinct.
I was firing readByte() before { openpgp.encrypt() & stream.getReader() } could actually complete.
(flowjs/flow.js#296)

@drzraf drzraf closed this May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants