Messages in child folders of `trash` are shown in tag views

Open
#252 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend, database

Research direction

The exclusion lives in the subquery in src/db/handlers.ts (around line 61) that filters out messages in the trash mailbox, and it only matches the trash folder itself, not its children. Read how mailboxes and their parent relationships are stored, then extend the filter so descendants of trash are excluded too. Done when a message moved to Deleted Items/2024 no longer appears in the tag view, reproduced by the steps in the issue.

Written by the indexing model from the issue text.

Description

Describe the bug

When viewing the list of messages with a specific tag, messages in the trash folder are not included in the list (as expected). However, tagged messages in a child folder below trash are included in the tag view (and this is unexpected).

To Reproduce

  1. Add a tag to a message in Deleted Items
  2. See that the message is not listed in the tag view
  3. Move the message to a child folder (e.g. Deleted Items/2024)
  4. See that this message is listed in the tag view

Expected behavior

Messages in child folders below trash should also not be shown in the tag view. I have confirmed that in Thunderbird the messages in child folders are also excluded from the tag view.

System

  • OS: Fedora Linux 44.20261111.0 (Silverblue)
  • Browser Version: Firefox 159.0.1 (64-Bit)

Additional context

The sub query for excluding messages in trash simply does not account for child folders.

The same behavior applies to the archive folder, but as I noted in https://github.com/thunderbird/stormbox/issues/237 we may want to show archived messages and not show messages in junk (and its child folders). Ultimately we should just apply the same logic to any of the excluded roles.

Dominant language
TypeScript
Stars
121
Forks
11
Avg merge
1d 3h
Merged PRs (30d)
11

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from thunderbird/stormbox

All issues in thunderbird/stormbox

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.