Repository navigation
Conversation
|
This branch has not been deployed
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.
Summary
Fixes Issue #6635 by ensuring that unhandled provider connection and authentication failures (such as rejected
getGrant()promises, network fetch rejections, and plain-text HTTP 400/503 responses) surface safe, sanitized feedback to the user instead of failing silently.Closes #6635
Problem
When a provider connection failed without returning a structured Companion error payload (e.g.
UserFacingApiError),handleErrorlogged the error to the console but leftuppy.getState().infocompletely empty. The UI provided zero feedback to the user. Furthermore, initial connection failures could leave the plugin in anauthenticated: trueor invalid state, locking the user out of the connection view and preventing retries.Changes
handleError.ts):handleErrorfor unhandled connection errors that emits a translated warning viauppy.info(uppy.i18n('companionError'), 'warning', 5000).AggregateErrorand.isRestriction) so local file drops are never accidentally relabeled as Companion connection failures.isAuthErrorandisAbortError, as well as structuredUserFacingApiErrormessages.Provider.ts):loginOAuthto strictly distinguish user cancellations (popup window closure or abort signals) from real backend/socket failures. User cancellations throw anAbortError(triggeringauthAborted), while socket/network dropouts bubble up as connection errors.ProviderView.tsx):authenticatedstate tofalsewhen initial root folder listing orhandleAuthfails, returning the UI back toAuthViewwith an active Connect button so the user can successfully retry once the grant or backend recovers.handleError.test.ts,Provider.test.ts,TransloaditStorage.browser.test.tsx):getGrant()rejections with sentinel strings, networkfetcherrors, plain-text 503 responses, and successful retry flows.Verification
@uppy/core,@uppy/transloadit-storage, and@uppy/s3pass successfully.corepack yarn typecheckand workspace checks pass with 0 errors.