-
Notifications
You must be signed in to change notification settings - Fork 69
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
TF-2769 Fix isolate illegal data #2792
Conversation
This PR has been deployed to https://linagora.github.io/tmail-flutter/2792. |
Cool however can you explain why we get the error in the first place? |
I would need to reproduce this bug to understand what went wrong. Will do. |
IMO, This is not the way to solve this problem. We need to find out why it failed to upload. |
WRONG We need to fix BOTH |
(sure I agree with you @dab246 that no error in the first place is non -gegociable however correct error management IS a must.) |
That's natural. Maybe you don't understand what I mean. WE NEED TO FIND THE CAUSE THAT CAUSED IT TO FAILED. As for the reason for displaying such a long error content in |
Sure I 100% that's why I commented in the first place: more investigations on the root cause are also needed. |
@chibenwa Added log. This might not be able to resolve from the app side if this is what happened to our tester. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Squash & rebase
8c8735c
to
d163fc7
Compare
d163fc7
to
1c3e9ad
Compare
Same root cause with #3129 |
Issue
Related documents
Root cause
We are using
lib/features/upload/data/network/file_uploader.dart:FileUploader:uploadAttachment:_handleUploadAttachmentAction
function to handle upload file in mobile, with the help ofDio
, inside a separate isolate with app's main isolate. When thisDio
throwDioError
exception, by any reason, this exception in turns get sent from this separate isolate to the main isolate. Inside thisDioError
, theRequestOptions:data
is sent back out of this separate isolate, with typeStream
, exactly the type we passed into this isolate byFile(argsUpload.mobileFileUpload.filePath).openRead()
. This type is not supported bysend()
function ofIsolate
(see above document), so this isolate throw its own exception, telling us that the type we're letting that isolate callsend()
is "illegal". Also, we're showing the whole stacktrace of the error if this case happens.Log
Scenario
The error showing in the demos below is on purpose, to show how the error is handled. In real cases, the attachments will be uploaded as normal.
Before
Screen.Recording.2024-04-10.at.17.54.00.mov
After
Screen.Recording.2024-04-10.at.17.50.22.mov