fix: sync unread counters after delete/archive operations (Closes #1404)#1408
Closed
kuishou68 wants to merge 1 commit into
Closed
fix: sync unread counters after delete/archive operations (Closes #1404)#1408kuishou68 wants to merge 1 commit into
kuishou68 wants to merge 1 commit into
Conversation
…atpane#1404) Co-authored-by: kuishou68 <54054995+kuishou68@users.noreply.github.com> Co-authored-by: pojian68 <232320289+pojian68@users.noreply.github.com> Signed-off-by: lingxiu58 <86288566+lingxiu58@users.noreply.github.com>
floatpanebot
requested changes
Jun 2, 2026
Member
floatpanebot
left a comment
There was a problem hiding this comment.
Hi @kuishou68! Please fix the following issues with your PR:
- Title: Is too long (72 characters). The PR title must be strictly under 40 characters.
- Body: Missing the
## What?or## Why?headings required by the PR template.
Member
Benchmark report — no significant changeMetrics worse: 0 · better: 0 (threshold: ±3%). benchstat outputauto-generated by benchmarks.yml |
Member
|
Please follow our format for writing pull request titles and descriptions. I'll review your PR after fixing it. |
Member
|
@kuishou68 who are the random co-authors? |
floatpanebot
requested changes
Jun 2, 2026
Member
floatpanebot
left a comment
There was a problem hiding this comment.
Hi @andrinoff! Please fix the following issues with your PR:
- Title: Is too long (72 characters). The PR title must be strictly under 40 characters.
- Body: Missing the
## What?or## Why?headings required by the PR template.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After deleting or archiving emails, the unread badge counter does not update immediately. The counter only refreshes on the next fetch cycle, leading to stale UI state.
Root Cause
Four message handlers in
main.goremove emails from stores but never callm.syncUnreadBadge()to recalculate the dock badge:DeleteEmailMsg(line 1785)ArchiveEmailMsg(line 1818)BatchDeleteEmailsMsg(line 1879)BatchArchiveEmailsMsg(line 1913)Compare with
EmailMarkedReadMsgandEmailMarkedUnreadMsgwhich correctly callm.syncUnreadBadge()after updating state.Fix
Added
m.syncUnreadBadge()call before the return statement in all four handlers, consistent with the existing pattern used byEmailMarkedReadMsgandEmailMarkedUnreadMsg.Co-authored-by: kuishou68 54054995+kuishou68@users.noreply.github.com
Co-authored-by: pojian68 232320289+pojian68@users.noreply.github.com
Signed-off-by: lingxiu58 86288566+lingxiu58@users.noreply.github.com