Add abort signal to upload#106
Merged
dajimenezriv-internxt merged 5 commits intomasterfrom Mar 6, 2026
Merged
Conversation
sg-gs
approved these changes
Mar 5, 2026
Member
sg-gs
left a comment
There was a problem hiding this comment.
LGTM. I will bump the version to 3.0.0 as this would be a breaking change for all the platforms as now the upload is a promise rather than a callback and the abort controller should be injected by the client itself
Contributor
Author
|
@sg-gs Okey, for now it was just the proposal. First it will be to merge the one from the |
larryrider
reviewed
Mar 5, 2026
sg-gs
approved these changes
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR goes together with this one: internxt/sdk#373. Currently we have some users that are saying that after aborting upload some files in a corrupted state. Looking at the code I think that cannot happen because of the abort, but it's true that some of the requests related to the
uploadare not being aborted.Since I was touching this code I decided to make a proposal by changing a bit how the
uploadfunction works, by instead of returning anActionStatethat canstop(), we accept anabortSignallike when doing requests and what theuploadfunction does is to return afileIdor throw an error. It will change how theuploadfunction is consumed, so I want to be sure that makes sense to make the proposal before going more deep and testing everything.I think that this new way will give more control to the client using the
uploadby letting the client decide how to manage theabortSignaland by just returning thefileIdvalue instead of using callbacks.What do you think?
[Update] Join
uploadanduploadMultipartfunctions and expose just oneuploadfunction.