Skip to content

fix(badge): dedupe unread count - #1398

Merged
andrinoff merged 1 commit into
floatpane:masterfrom
FromSi:fix/unread-badge-dedupe
Jun 1, 2026
Merged

fix(badge): dedupe unread count#1398
andrinoff merged 1 commit into
floatpane:masterfrom
FromSi:fix/unread-badge-dedupe

Conversation

@FromSi

@FromSi FromSi commented Jun 1, 2026

Copy link
Copy Markdown
Member

What?

Deduplicate unread badge counting across emailsByAcct and folderEmails by tracking seen emails with AccountID + UID.

Added a regression test for the case where the same unread email exists in both stores.

image

Why?

Closes #1107

syncUnreadBadge counted unread emails from both stores independently, but the stores can contain the same fetched messages. This could make the macOS unread badge show roughly double the real unread count.

image

@FromSi
FromSi requested a review from a team as a code owner June 1, 2026 16:38
@floatpanebot floatpanebot added bug Something isn't working os/macos macOS-specific size/M Diff: 51–200 lines labels Jun 1, 2026
@andrinoff andrinoff added the backport/v1 Merge to master and backport to release/v1 label Jun 1, 2026

@andrinoff andrinoff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@andrinoff
andrinoff added this pull request to the merge queue Jun 1, 2026
Merged via the queue into floatpane:master with commit cbd1137 Jun 1, 2026
29 checks passed
@floatpanebot floatpanebot added the backported Cherry-picked onto release/v1 label Jun 1, 2026
floatpanebot pushed a commit that referenced this pull request Jun 1, 2026
## What?

Deduplicate unread badge counting across `emailsByAcct` and
`folderEmails` by tracking seen emails with `AccountID + UID`.

Added a regression test for the case where the same unread email exists
in both stores.

<img width="595" height="652" alt="image"
src="https://github.com/user-attachments/assets/8c837fb8-017c-4c7c-aa2c-052f244288b2"
/>

## Why?

Closes #1107

`syncUnreadBadge` counted unread emails from both stores independently,
but the stores can contain the same fetched messages. This could make
the macOS unread badge show roughly double the real unread count.

<img width="598" height="647" alt="image"
src="https://github.com/user-attachments/assets/f2b1c267-29bc-4d4c-a116-4c91af789722"
/>

(cherry picked from commit cbd1137)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/v1 Merge to master and backport to release/v1 backported Cherry-picked onto release/v1 bug Something isn't working os/macos macOS-specific size/M Diff: 51–200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: syncUnreadBadge double-counts mail in both stores

3 participants