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

Add Ability to Cancel File upload from `processF… #5717

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

raystorm
Copy link

Description of changes

Adds support for the ability to cancel an Upload from processFile()
by returning a rejected promise.

Issue #, if available

#5099

Description of how you validated changes

  • Added a Unit Test to ensure removeUpload() is called when a rejected promise is returned from processFile().
  • Added a New Example, that forces a Promise.reject() in examples.
    ran the example manually with additional Logging code
    (not committed, and now removed to watch/verify operation.)

Checklist

  • Have read the Pull Request Guidelines
  • PR description included
  • Relevant documentation is changed or added (and PR referenced)
  • yarn test passes and tests are updated/added
  • No side effects or sideEffects field updated

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


Per @reesscot on #5179

There's a lot of files being changed in this PR that aren't related to your change, so we're not going to be able to merge this as is. Can you please squash your changes and rebase them against the latest version of main? Looks like something went wrong with resolving merge conflicts.

I don't know a good way to easily squash and rebase my changes.
So I created a new branch from main and copied over the current version of that code instead.

CC: @calebpollman

…ile`

Adds ability to cancel uploads by throwing or rejecting the promise from `processFile.`
Adds ability to react to/monitor errors with a new function and type
  * `onProcessFileError()` and `ProcessFileErrorParams`

Changes:
  + adds new option user function `onProcessFileError()` to monitor errors
  + adds a new parameter type for the new function `ProcessFileErrorParams`
  * wraps `processFile in `resolveFile()` to handle the error safely
  + adds a usage example
  + adds tests
  * Updates Props list in the docs with the new method.
@raystorm raystorm requested a review from a team as a code owner August 30, 2024 02:31
Copy link

changeset-bot bot commented Aug 30, 2024

🦋 Changeset detected

Latest commit: d6e4d99

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@aws-amplify/ui-react-storage Patch

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

@raystorm
Copy link
Author

raystorm commented Sep 5, 2024

@reesscot and @calebpollman
I Hope moving to a new PR didn't mess things up on your side to get this done. Is there anything else you need from me?

@raystorm
Copy link
Author

@reesscot @calebpollman
These Conflicts are going to keep happening.
This ask has been since April.
What can I do to get this accepted, BEFORE, another bad merge happens again?

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.

1 participant