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

@uppy/provider-views: fix race conditions with folder loading #4578

Merged
merged 5 commits into from
Jul 20, 2023

Conversation

mifi
Copy link
Contributor

@mifi mifi commented Jul 14, 2023

multiple race conditions / bugs:

  • If you open a folder in e.g. facebook and you scroll down, triggering the infinity scroll, and then go back (one folder up) before the infinity scroll has finished loading, you could end up with the contents of the scrolled folder instead of the previous folder
  • if you select a folder structure (e.g. deep structure with many files) and then click "cancel" while loading, it will still continue loading recursively in the background even after cancelled and potentially cause more issues down the road
    solved by always using an abortcontroller and aborting any ongoing request whem the user performs a new action

multiple race conditions / bugs:
- If you open a folder in e.g. facebook and you scroll down, triggering the infinity scroll, and then go back (one folder up) before the infinity scroll has finished loading, you could end up with the contents of the scrolled folder instead of the previous folder
- if you select a folder structure (e.g. deep structure with many files) and then click "cancel" while loading, it will still continue loading recursively in the background even after cancelled and potentially cause more issues down the road
Copy link
Member

@Murderlon Murderlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one

@Murderlon Murderlon changed the title fix multiple race conditions @uppy/provider-views: fix race conditions with folder loading Jul 17, 2023
@arturi arturi self-requested a review July 17, 2023 11:05
mifi and others added 4 commits July 19, 2023 21:59
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* main:
  @uppy/status-bar: fix ETA when status bar is installed during upload (#4588)
  @uppy/provider-views: fix infinite folder loading  (#4590)
  examples/aws: client-side signing (#4463)
@arturi arturi merged commit ecdecd1 into main Jul 20, 2023
@arturi arturi deleted the race-conditions branch July 20, 2023 13:20
@github-actions github-actions bot mentioned this pull request Jul 20, 2023
github-actions bot added a commit that referenced this pull request Jul 20, 2023
| Package                | Version | Package                | Version |
| ---------------------- | ------- | ---------------------- | ------- |
| @uppy/aws-s3-multipart |   3.5.1 | @uppy/provider-views   |   3.4.1 |
| @uppy/companion-client |   3.2.2 | @uppy/status-bar       |   3.2.3 |
| @uppy/dashboard        |   3.5.0 | @uppy/utils            |   5.4.2 |
| @uppy/locales          |   3.2.4 | uppy                   |  3.13.0 |

- meta: Add i18n to CONTRIBUTING.md (Mikael Finstad / #4591)
- @uppy/provider-views: Add VirtualList to ProviderView (Merlijn Vos / #4566)
- @uppy/provider-views: fix race conditions with folder loading (Mikael Finstad / #4578)
- @uppy/status-bar: fix ETA when status bar is installed during upload (Antoine du Hamel / #4588)
- @uppy/provider-views: fix infinite folder loading  (Mikael Finstad / #4590)
- meta: examples/aws: client-side signing (Antoine du Hamel / #4463)
- meta: Bump word-wrap from 1.2.3 to 1.2.4 (dependabot[bot] / #4586)
- meta: e2e: increase `requestTimeout` to 16s (Antoine du Hamel / #4587)
- @uppy/locales: update zh_TW translation (5idereal / #4583)
- @uppy/aws-s3-multipart: fix crash on pause/resume (Merlijn Vos / #4581)
- @uppy/aws-s3-multipart: do not access `globalThis.crypto` on the top-level (Bryan J Swift / #4584)
Murderlon added a commit that referenced this pull request Jul 25, 2023
* main:
  @uppy/aws-s3-multipart: refresh file before calling user-defined functions (#4557)
  Release: uppy@3.13.0 (#4595)
  Add i18n to CONTRIBUTING.md (#4591)
  Add VirtualList to ProviderView (#4566)
  @uppy/provider-views: fix race conditions with folder loading (#4578)
  @uppy/status-bar: fix ETA when status bar is installed during upload (#4588)
  @uppy/provider-views: fix infinite folder loading  (#4590)
  examples/aws: client-side signing (#4463)
  Bump word-wrap from 1.2.3 to 1.2.4 (#4586)
  e2e: increase `requestTimeout` to 16s (#4587)
  @uppy/locales: update zh_TW translation (#4583)
  @uppy/aws-s3-multipart: fix crash on pause/resume (#4581)
  @uppy/aws-s3-multipart: do not access `globalThis.crypto` on the top-level (#4584)
  Release: uppy@3.12.0 (#4574)
  @uppy/transloadit: fix error message (#4572)
  @uppy/provider-views: add support for remote file paths (#4537)
  @uppy/transloadit: implement Server-sent event API (#4098)
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.

4 participants