Skip to content

Conversation

dab246
Copy link
Member

@dab246 dab246 commented May 26, 2025

Issue

Cannot upload multiple attachment when token expired.

PlatformException(token_failed, Concurrent operations detected: token, token, null, null)

Root cause

The application uses Dio with AuthorizationInterceptor to automatically attach access tokens to HTTP requests. When the token expires, the interceptor will refresh the token to get a new token. However, when multiple uploads (multi-file) run in parallel, or uploads run in separate isolates, requests with 401 errors will simultaneously trigger token refresh, leading to multiple calls to the refreshingTokensOIDC(...) function at the same time. This causes internal errors from the platform channel because it does not support simultaneous operations

Solution

  • Use Async, await to replace for isolate when upload attachment

Resolved

demo-android.online-video-cutter.com.mp4

Signed-off-by: dab246 <tdvu@linagora.com>
Copy link

This PR has been deployed to https://linagora.github.io/tmail-flutter/3751.

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.

2 participants