Storage uploads can capture the previous folder during navigation
Why
A Storage upload can target the folder the user just left while the new folder's listing is still pending. This is separate from the standalone file-manager redesign in #6628.
Reproduced in Content using the published @uppy/[email protected] + @uppy/[email protected], a deferred in-memory Companion response, and Chromium. No production files were written.
Reproduction
- Open the Storage root, with a
docs/folder. - Defer the response to
/transloadit-storage/list/docs%2Fand clickdocs/. - While it loads,
Upload filesremains enabled. Invoking its real toolbar action passesprefix: ''toonUploadRequest. - Release the response: the displayed folder becomes
docs/, but the upload modal captured the old root destination.
ProviderView.openFolder() sets loading before fetching and updates currentFolderId after the response. The Header's busy state only covers long operations, not a pending listing. Storage reads the old current folder when dispatching the upload action. Drops also need protection: disabling only the toolbar does not fix them.
Expected contract
- Folder-dependent writes are unavailable while navigation is unresolved; failure/cancellation restores a usable browser.
- A rejected drop tells the user to retry after the folder loads, without signing or starting an Assembly.
- Accepted batches retain their destination until completed/cancelled. Closing a modal and reopening it from another folder must not silently retarget queued files.
- The destination is pinned when files are accepted, not when an asynchronous signer eventually runs. Session-root prefixes and read-only sessions remain respected.
Content’s final interim patch keeps global busy unchanged and uses a separate actionsDisabled signal for folder-dependent toolbar actions and selection while a listing is pending. Breadcrumb navigation, search, logout, and long-operation cancellation retain their existing behavior. Its application-owned upload queues pin accepted destinations and reject unresolved drops. Unit tests first reproduced both the pending-drop and queued-modal failures. The delayed-listing browser test first failed on the still-enabled button, then passed and verified the actual signed /transloadit/store path is docs/${file.name} before completing the mocked upload and refreshed listing.
The application changes are deliberately separate from the npm migration (content#6161). We would like the reusable destination/admission contract to live in Uppy's standalone manager/provider API, not a second manager implementation in Content. No request to accelerate the redesign or release is implied.
Patch-retirement coordination and published-version gates: #6637. Final consumer browser/review evidence: https://github.com/transloadit/content/pull/6164#issuecomment-5890979588.
Source: transloadit/uppy