Skip to content

TF-3739 Fix error when uploading several attachments on android #3751

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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