Skip to content

fix: 9142 search results disappearing#11032

Open
numericOverflow wants to merge 2 commits into
thunderbird:mainfrom
numericOverflow:fix/9142-search-results-disappearing
Open

fix: 9142 search results disappearing#11032
numericOverflow wants to merge 2 commits into
thunderbird:mainfrom
numericOverflow:fix/9142-search-results-disappearing

Conversation

@numericOverflow
Copy link
Copy Markdown

@numericOverflow numericOverflow commented May 20, 2026

Summary

When a remote search saves an envelope-only message and a subsequent sync replaces it with the full message, the database.replace() call deletes and re-inserts the row. This orphans the corresponding threads entry (foreign key on messages.id), causing the message to disappear from search results.

Switching from replace() to update() preserves the row ID and keeps the thread reference intact.

Issue

Fixes #9142

Test plan

  • Added test: replace envelope message with full message verifies thread entry preserved
  • Existing tests pass (SaveMessageOperationsTest)

AI disclosure

AI was used to assist in tracking down source of bug, correcting & drafting this pull request description. It wasn't a simple vibe code job, I did interrogate it on plan and helped it choose the most appropriate, reliable and logical solution.

I tested the resulting build on my android device and confirmed it fixed the bug that has been outstanding for several years.

Supporting information:

Report from Claude 4.6 (High)
root-cause-analysis.md

Solution that was implemented after discussion and design choices from Claude 4.6 (High)
final-solution-proposal.md

report: include

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Validation Passed: All report and feature-flag labels are correctly set.

@numericOverflow numericOverflow marked this pull request as ready for review May 20, 2026 22:06
@numericOverflow numericOverflow requested a review from a team as a code owner May 20, 2026 22:06
@numericOverflow numericOverflow requested a review from wmontwe May 20, 2026 22:06
@wmontwe wmontwe added the report: include Include changes in user-facing reports. label May 28, 2026
@wmontwe wmontwe changed the title Fix/9142 search results disappearing fix: 9142 search results disappearing May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

report: include Include changes in user-facing reports.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Often when I search for mails and trigger the server search the results will be shown for a blink/second but then disappaear again afterwards

2 participants