Commit cbd1137
authored
fix(badge): dedupe unread count (#1398)
## 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"
/>1 parent e4987f3 commit cbd1137
2 files changed
Lines changed: 49 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 245 | + | |
249 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
250 | 261 | | |
251 | | - | |
| 262 | + | |
252 | 263 | | |
253 | | - | |
254 | | - | |
255 | | - | |
| 264 | + | |
256 | 265 | | |
257 | 266 | | |
258 | 267 | | |
259 | | - | |
| 268 | + | |
260 | 269 | | |
261 | | - | |
262 | | - | |
263 | | - | |
| 270 | + | |
264 | 271 | | |
265 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
266 | 285 | | |
267 | 286 | | |
268 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
0 commit comments