fix(search): scope the unread quick-filter to the current folder - #880
Open
shukiv wants to merge 1 commit into
Open
fix(search): scope the unread quick-filter to the current folder#880shukiv wants to merge 1 commit into
shukiv wants to merge 1 commit into
Conversation
Clicking a folder's unread count (e.g. Inbox: 29) enabled the unread filter and ran advancedSearch with no folder scope, so searchMailboxId stayed "" and buildJMAPFilter added no inMailbox constraint — the result listed unread mail from every folder, including Trash and Spam, which contradicts the folder-local badge the user clicked. Set searchMailboxId to the clicked mailbox when enabling the filter (and clear it when toggling off) so the unread view matches the count.
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.
Bug
Clicking a folder's unread count (e.g. Inbox: 29) opens a list that includes unread mail from every folder — Trash, Spam, etc. — contradicting the folder-local badge that was clicked.
Cause
handleUnreadFilterClickenables the unread filter and callsadvancedSearch, but never setssearchMailboxId. It stays"", sobuildJMAPFilteradds noinMailboxconstraint and the search spans all mailboxes.Fix
Set
searchMailboxIdto the clicked mailbox when enabling the filter (clear it when toggling off), so the unread view is scoped to that folder and matches the count. One file,components/mail/mail-app.tsx.Testing
tsc --noEmitclean.