From 16f362a61a95567ad954b73052c6d9f00a0c3d20 Mon Sep 17 00:00:00 2001 From: dab246 Date: Mon, 5 Feb 2024 16:21:57 +0700 Subject: [PATCH] TF-2536 Add `adr` for logic to get all mailbox Signed-off-by: dab246 --- .../0034-change-the-logic-get-all-mailbox.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 docs/adr/0034-change-the-logic-get-all-mailbox.md diff --git a/docs/adr/0034-change-the-logic-get-all-mailbox.md b/docs/adr/0034-change-the-logic-get-all-mailbox.md new file mode 100644 index 000000000..41770268d --- /dev/null +++ b/docs/adr/0034-change-the-logic-get-all-mailbox.md @@ -0,0 +1,25 @@ +# 34. Change the logic to get all mailbox to avoid miss mailbox (#2536) + +Date: 2024-02-05 + +## Status + +Accepted + +## Context + +- Currently `MailboxRepository` get the data from local first: + - if cache hit `(have mailbox + cache)`, `/changes` to update + - if cache miss `(no mailbox, no state)`, `/get` to update view + +What happen if cache hit, but not have all the data? Yep, this is the issue. + +## Decision + +- Change the logic to get all mailbox + - Get from the local `(support quick response and offline mode)` -> yield to UI + - Get `Mailbox/get` from JMAP to update the list of mailbox correctly -> yield to UI + +## Consequences + +- No more lost mailboxes. The latest mailbox list is always updated.