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

Emit progress events in Node.js again #656

Merged
merged 2 commits into from
Dec 7, 2023
Merged

Emit progress events in Node.js again #656

merged 2 commits into from
Dec 7, 2023

Conversation

Acconut
Copy link
Member

@Acconut Acconut commented Dec 7, 2023

Fixes #602.

Basically, in some previous release tus-js-client lost the ability to emit progress events when used in Node.js with a data source other than a fs.ReadStream. This was caused by changes in our internal logic for reading data from the sources.

This PR fixes the problem by making sure that we also emit progress events if a Buffer is written to the writable stream for a HTTP request. The details are explained in the code.

The code itself is ready for a review, but I want to see if I can add a test for this, so we can avoid similar regressions in the future. EDIT: Test has been added.

@Acconut Acconut added the nodejs Issues with tus-js-client in Node.js label Dec 7, 2023
@Acconut Acconut requested a review from mifi December 7, 2023 09:33
@Acconut Acconut self-assigned this Dec 7, 2023
@Acconut Acconut marked this pull request as ready for review December 7, 2023 10:07
@Acconut Acconut merged commit 8cc91de into main Dec 7, 2023
8 of 10 checks passed
@Acconut Acconut deleted the nodejs-progress branch December 7, 2023 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nodejs Issues with tus-js-client in Node.js
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-file-based streams in Node.js do not receive progress events
1 participant