Skip to content

fix: 9142 search results disappearing#11032

Merged
wmontwe merged 2 commits into
thunderbird:mainfrom
numericOverflow:fix/9142-search-results-disappearing
Jun 11, 2026
Merged

fix: 9142 search results disappearing#11032
wmontwe merged 2 commits into
thunderbird:mainfrom
numericOverflow:fix/9142-search-results-disappearing

Conversation

@numericOverflow

@numericOverflow numericOverflow commented May 20, 2026

Copy link
Copy Markdown
Contributor

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

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

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

@rugk rugk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! This sounds promising!

@wmontwe wmontwe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

@wmontwe wmontwe merged commit 8cdcba5 into thunderbird:main Jun 11, 2026
20 of 23 checks passed
@thunderbird-botmobile

Copy link
Copy Markdown
Contributor

Thanks for your contribution! Your pull request has been merged and will be part of Thunderbird 21. We appreciate the time and effort you put into improving Thunderbird. If you haven’t already, you’re welcome to join our Matrix chat for contributors. It’s where we discuss development and help each other out. https://matrix.to/#/#tb-android-dev:mozilla.org
Hope to see you there! 🚀📱🐦

@thunderbird-botmobile thunderbird-botmobile Bot added this to the Thunderbird 21 milestone Jun 11, 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

3 participants