From c856ee07fc05a7a864bb7cace1e7346c28a67ada Mon Sep 17 00:00:00 2001 From: Dang Dat Date: Fri, 18 Sep 2026 11:37:29 +0700 Subject: [PATCH] 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 --- .../adr/0109-oversize-attachment-recovery-seam.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/adr/0109-oversize-attachment-recovery-seam.md b/docs/adr/0109-oversize-attachment-recovery-seam.md index fe6125417..b878052bf 100644 --- a/docs/adr/0109-oversize-attachment-recovery-seam.md +++ b/docs/adr/0109-oversize-attachment-recovery-seam.md @@ -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