From 9473599238b594d5605eb65b71e6e1fadc78690c Mon Sep 17 00:00:00 2001 From: DatDang Date: Wed, 28 Feb 2024 09:11:49 +0700 Subject: [PATCH] TF-2628 [Part-2] Create ADR for multiple attachment actions handling logic --- .../0040-handle-multiple-attachment-actions | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs/adr/0040-handle-multiple-attachment-actions diff --git a/docs/adr/0040-handle-multiple-attachment-actions b/docs/adr/0040-handle-multiple-attachment-actions new file mode 100644 index 000000000..104834584 --- /dev/null +++ b/docs/adr/0040-handle-multiple-attachment-actions @@ -0,0 +1,28 @@ +# 40. Handle multiple attachment actions + +Date: 2024-02-28 + +## Status + +Accepted + +## Context + +- Attachment can be tapped even if its previous action (download/view) is still handling +- When user tap one attachment multiple times, race condition can happen + +## Decision + +1. When an attachment is prepared to download/view: + +- Tapping function of that attachment will be disabled +- The attachment icon in front of the attachment name will be replaced by a loading UI + +2. When an attachment is downloaded/viewed: + +- Tapping function of that attachment will be enabled +- The attachment icon in front of the attachment name will be returned + +## Consequences + +- The attachment button on Twake Mail will now only be tapped once per handling, improving performance & prevent multiple actions by mistake