-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(differentialDownloader): improve error handling and timeout management in multipleRangeDownloader #9071
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
base: master
Are you sure you want to change the base?
Conversation
…ement in multipleRangeDownloader
🦋 Changeset detectedLatest commit: 0a16de6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
response.pipe(dicer) | ||
|
||
response.on("end", () => { | ||
setTimeout(() => { | ||
timeoutId = setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to store timeoutId
for anything? Curious as to why we need to have wrappedReject
. I was under the impression setTimeout
without storing its ID would auto-release when GC'd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reject
does seem unnecessary now, as it has already failed. At the time of writing, it was done for consistency, so both resolve
and reject
were included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see timeoutId
but only being cleared on resolve now. Why can't we reuse previous logic and only change the timeout?
Are we simply detecting whether the timeout is working properly? e.g. are we attempting to resolve and reject the promise in the same flow so we're hitting a race condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@beyondkmp can you please follow up here when you have a chance? Then we can proceed with the PR
fix #9063