From 01194fa2c48019f1dcbdfefac94f8fd5f8e38122 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 7 Aug 2026 19:17:59 +0200 Subject: feat(sync): sync only the accounts with unsynced edits A sync ran mbsync -a regardless of what changed, so tagging mail in one account fetched all of them. The account set was not a parameter anywhere on the path: MailSync::start() took no arguments and the script hardcoded -a, so nothing between a tag edit and mbsync carried which account changed. Track which accounts have edits and pass their mbsync channels through to the script, which now takes channel names and falls back to -a when given none. An empty set means all accounts, per the request: a sync with nothing pending is a fetch, and narrowing that to wherever the last edit landed would quietly stop collecting mail everywhere else. The channel is a new optional per-account key rather than the section key. The two names genuinely diverge, because a QSettings section key may carry dots that the channel does not, and mbsync treats an unknown channel as fatal rather than skipping it, so key-as-channel would fail those accounts' syncs outright rather than degrade. It defaults to the key, so accounts whose two names already agree need no config change. The edited-account set is deliberately not netted the way the pending-edit map is: that map tracks the index, where a tag removed and re-added leaves nothing outstanding, while this tracks the mail store, where both writes have already renamed files that mbsync still has to propagate. It is also snapshotted before flushHeldEdits(), which inserts into it synchronously rather than on a queued reply, so a successful sync cannot clear accounts whose edits it never carried. Closes item 49. Co-Authored-By: Claude Opus 5 --- docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'docs/superpowers/plans') diff --git a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md index 1cc75a7..ffdc8d5 100644 --- a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md +++ b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md @@ -97,7 +97,7 @@ taking that too literally. | 46 | `uiStateSurvivesARestart` fails under the offscreen platform | testing | XS | **done** | | 47 | The query bar looks unfinished, and cannot be cleared by mouse | presentation | XS | **done** | | 48 | Removing a tag suggests every tag, not the thread's own | workflow | XS | **done** | -| 49 | Sync runs every account regardless of what changed | workflow | M | open | +| 49 | Sync runs every account regardless of what changed | workflow | M | **done** | | 50 | Esc blanks the pane but leaves the row selected | workflow | XS | **done** | | 51 | Clicking a subject scrolls the list sideways | presentation | XS | open | | 52 | `test_querycompleter` fails under Wayland, passes offscreen | testing | XS | **done** | @@ -2881,6 +2881,17 @@ Nothing between the tag edit and mbsync carries which account changed. a display `label`); mapping to a channel needs either a new per-account key or an explicit decision that the key IS the channel. Settle this with the user before building, it is the one design question in the item. + + **Resolved 2026-08-07 by reading the user's real mbsync config against their + qtmaildir config: a new key is required.** Three of five accounts match their + channel name exactly, and two do not, because a QSettings section key may + carry dots that the channel does not: a section `[account.mail-first.last]` + against a channel `mail-firstlast`. Key-as-channel would therefore name two + channels mbsync does not know, and mbsync treats an unknown channel as fatal, + so those two accounts' syncs would fail outright rather than degrade. The + `maildir` key tracks the section key rather than the channel and is no help. + Built as an optional `channel` key defaulting to the section key, so the three + matching accounts need no config edit. - **`notmuch new` still runs over everything**, and must. Restricting the fetch does not restrict the index. - **The script's two shipped properties survive**: it prints to stdout as well as -- cgit v1.2.3