mirror of
https://github.com/linagora/tmail-flutter.git
synced 2026-12-06 00:05:29 +00:00
Scope the recovery seam to size rejections on picked files
Addresses: 4034661133, 4043492871, 4043481991 https://github.com/linagora/tmail-flutter/pull/4839#discussion_r4034661133 https://github.com/linagora/tmail-flutter/pull/4839#discussion_r4043492871 https://github.com/linagora/tmail-flutter/pull/4839#discussion_r4043481991
This commit is contained in:
1 parent
34577c7e22
commit
c856ee07fc
1 file changed
+13
-2
@@ -30,14 +30,25 @@ Accepted
|
||||
|
||||
### Recovery before the failure dialog
|
||||
|
||||
- A rejected upload may be handed to a recovery first; the dialog is the fallback.
|
||||
- A recovery is an alternative ending for a rejection.
|
||||
- It takes the rejected files somewhere else and tells the user what happened.
|
||||
- The first one, landing later, uploads the oversize files to Drive and links them in the body.
|
||||
- The dialog is what shows whenever no recovery runs:
|
||||
- none is registered,
|
||||
- the rejection carries no files to act on,
|
||||
- or the registered recovery declines that failure.
|
||||
- A recovery that takes over owns every user-visible outcome, failure toasts included.
|
||||
- It never falls back to the dialog.
|
||||
|
||||
- Only a rejection on picked files reaches a recovery.
|
||||
- `validateFiles` carries the picked files, so a recovery has the bytes to upload.
|
||||
- `validateAttachment` re-attaches an existing JMAP attachment with no file behind it,
|
||||
so its rejections go straight to the dialog.
|
||||
- The validation request carries the picked files, so a recovery knows what to act on.
|
||||
|
||||
```
|
||||
on ValidationRejected(failure):
|
||||
if recovery?.recover(failure, request) == true:
|
||||
if request.files.isNotEmpty and recovery?.recover(failure, request) == true:
|
||||
return false # recovery owns the UX from here
|
||||
feedback.showFailure(failure) # today's dialog
|
||||
return false
|
||||
|
||||
Reference in new issue
Block a user