Skip to content

req.multipart() does not await for all multipartfield handler async functions? #100

Answered by BobbyWibowo
BobbyWibowo asked this question in Q&A
Discussion options

You must be logged in to vote

Ah, my bad, it wasn't that it did not await
It did await properly with that example code in the original post

Instead, from what I can tell, req.multipart resolves early when field.file.stream has been consumed by the first Transform/Writable stream I piped it into, even though the handler function is still supposed to await for the remaining destination streams if any

So assuming I have multi-step pipes:

field.file.stream
  .pipe(destStream1)
  .pipe(destStream2)

req.multipart() somehow resolves after destStream1 has finished consuming the stream, even though destStream2 is still doing it things

Replies: 3 comments 11 replies

Comment options

You must be logged in to vote
3 replies
@kartikk221
Comment options

@BobbyWibowo
Comment options

@kartikk221
Comment options

Comment options

You must be logged in to vote
5 replies
@kartikk221
Comment options

@BobbyWibowo
Comment options

@kartikk221
Comment options

@BobbyWibowo
Comment options

@kartikk221
Comment options

Answer selected by kartikk221
Comment options

You must be logged in to vote
3 replies
@BobbyWibowo
Comment options

@BobbyWibowo
Comment options

@kartikk221
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants