From caa34f1f4616b6c3e7a11295e7b07fe303b183fb Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 8 Sep 2026 11:17:29 +0200 Subject: feat: make Sync follow the account being looked at Item 101. The sync run was already account-aware for pending edits and consulted the account dropdown for nothing, so looking at one account and pressing Sync collected every one of them. pendingSyncChannels() now reads the dropdown as well as m_editedAccounts. The two are a UNION rather than one replacing the other, which is the whole safety property: looking at one account while having edited another is ordinary, and a run that dropped the edited account's channel would strand that write with nothing on screen to say so. All accounts is the empty key and narrows nothing, so a full fetch stays what an unselected window asks for. The existing fallback is untouched: an account whose section names no channel still widens the run rather than being silently skipped. syncStartedText() is the visibility half. A run opened with "Syncing..." whether it covered one account or all of them; it now names what it covers. The exit paths overwrite the label with their own wording immediately, so the parameter is defaulted rather than threaded through them. Four tests. The narrowing one asserts the channel list is EMPTY before the gesture, since empty is what a full fetch looks like and a test starting from a narrowed state could not tell the fix from a window that had never widened. Mutation-checked twice: ignoring the selection fails three of them, and replacing the pending set instead of unioning with it fails the union test alone, which is the version that looks correct and loses a write. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01KphFXTc2QajxXsHWyvGJ4R --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 4ae0034..affff11 100644 --- a/README.md +++ b/README.md @@ -655,11 +655,16 @@ Two things any replacement has to get right, both learned the hard way: ### Per-account sync -When tag changes are outstanding, a sync passes only the affected accounts' -channel names to the command. When nothing is outstanding the run is a plain -fetch and no names are passed, so every account is synced: narrowing a fetch to -wherever the last edit happened to be would quietly stop collecting mail -everywhere else. +A sync covers the account selected in the dropdown, plus any account with +outstanding tag changes. With **All accounts** selected and nothing +outstanding, no names are passed and the run is a plain fetch over everything: +narrowing a fetch to wherever the last edit happened to be would quietly stop +collecting mail everywhere else. + +The two are a union rather than a choice, so an edit is never left behind by +looking somewhere else. Editing mail in `personal` and then switching the +dropdown to `work` syncs both: `work` because it is on screen, `personal` +because it owes a write. The status line names what a run covers as it starts. The name passed is the **mbsync channel**, which is not always the account's section key. `[account.mail-first.last]` may well be the channel -- cgit v1.2.3