Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix assert-crash due to excessive scores length #63

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

slusarz
Copy link
Owner

@slusarz slusarz commented Mar 11, 2024

For searches that hit multiple mailboxes (virtual mailboxes is an easy way to force a multisearch), an assert-crash will happen if a message matches both the main query and internal "maybe" queries.

Fix by ensuring that scores are only added once per UID.

This was broken in single mailbox search as well, but it was ignored there as there was no assert check on scores length (the extra entries were ignored during processing).

In order to calcuate scores correctly (now that we are only adding them once), refactor result iteration to only run the maybe query once for all maybe queries. Add the main query to this query for score calculation purposes. This is a bit of an optimization, so nice.

Fixes GitHub Issue #61

For searches that hit multiple mailboxes (virtual mailboxes is an easy way
to force a multisearch), an assert-crash will happen if a message
matches both the main query and internal "maybe" queries.

Fix by ensuring that scores are only added once per UID.

This was broken in single mailbox search as well, but it was ignored there
as there was no assert check on scores length (the extra entries were ignored
during processing).

In order to calcuate scores correctly (now that we are only adding them once),
refactor result iteration to only run the maybe query once for all maybe
queries.  Add the main query to this query for score calculation purposes.
This is a bit of an optimization, so nice.

Fixes GitHub Issue #61
@slusarz slusarz linked an issue Mar 11, 2024 that may be closed by this pull request
@slusarz slusarz merged commit 30ad313 into master Mar 11, 2024
4 checks passed
@slusarz slusarz deleted the issue-61 branch March 11, 2024 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assertion crash for search in virtual mailbox
1 participant