Betterbird / thunderbird-patches

Betterbird is a fork of Mozilla Thunderbird. Here are the patches that provide all the goodness.
Other
507 stars 20 forks source link

Quick filter issue on virtual folder with complex search term #365

Open viking2 opened 2 days ago

viking2 commented 2 days ago

I have created a complex filter:

Byu4dMU 1

After I have read a message from "Groupon", "Swagbucks" or "Linkedin", I do not want it to show up in the message pane anymore. This works great (note that I need to select another folder and then come back for the read messages to disappear)!

I also do not want messages from xyz to show up at all unless the subject contains "you have been". That is the purpose of the last two lines. This works fine as well.

However, when I perform a quick search for "Groupon" it also finds "Swagbucks" and "Linkedin". If I remove the last two lines in the complex filter, a quick search on "Groupon" only finds "Groupon" as it should.

Why do the last two lines affect the quick search? Is it a bug or am I missing something?

Betterbird commented 2 days ago

(note that I need to select another folder and then come back for the read messages to disappear)

Already discussed here: https://forums.mozillazine.org/viewtopic.php?p=14985872 Amazing, you ask the same question again and get the same answer.

As for the other question: Since you're searching a virtual folder that is defined by a rather complex expression, it's possible that joining the quick filter terms creates an incorrect expression.

To diagnose this, the system actually dumps out the resulting search term to the console. Please submit this information.

Example: Condition: AND [from,contains,huhu) OR (to or cc,contains,huhu) OR (subject,contains,huhu] [QuickFilterManager.sys.mjs:624:15](resource:///modules/QuickFilterManager.sys.mjs)

However, that only shows the part generated by the QF, we would have to ship you a special version to dump out the entire term. In the meantime, can you provide the definition of the search term from virtualFolders.dat.

viking2 commented 2 days ago

(note that I need to select another folder and then come back for the read messages to disappear)

Already discussed here: https://forums.mozillazine.org/viewtopic.php?p=14985872 Amazing, you ask the same question again and get the same answer.

Actually, it was not a question. I only mentioned it in case someone wanted to try the complex filter for themselves.

As for the other question: Since you're searching a virtual folder that is defined by a rather complex expression, it's possible that joining the quick filter terms creates an incorrect expression.

To diagnose this, the system actually dumps out the resulting search term to the console. Please submit this information.

Example: Condition: AND [from,contains,huhu) OR (to or cc,contains,huhu) OR (subject,contains,huhu] [QuickFilterManager.sys.mjs:624:15](resource:///modules/QuickFilterManager.sys.mjs)

Here is the search term from the console: Condition: AND [from,contains,groupon] QuickFilterManager.jsm:605:15

However, that only shows the part generated by the QF, we would have to ship you a special version to dump out the entire term. In the meantime, can you provide the definition of the search term from virtualFolders.dat.

Here is the search Term definition from virtualFolders.dat: terms=OR [date,is after,01-Jan-2024) AND (status,isn't,read) AND [from,contains,Groupon) OR (from,contains,Linkedin) OR (from,contains,Swagbucks]] OR [date,is after,01-Jan-2024) AND (from,doesn't contain,Groupon) AND (from,doesn't contain,Linkedin) AND (from,doesn't contain,Swagbucks) AND [from,doesn't contain,xyz) OR (subject,contains,you have been]] searchOnline=false

Betterbird commented 2 days ago

Can you supply the data/folder the virtual folder is based on. Otherwise it will be too laborious to craft the data to execute the query on. Or any other stripped down version that will demonstrate the issue.

viking2 commented 2 days ago

Can you supply the data/folder the virtual folder is based on. Otherwise it will be too laborious to craft the data to execute the query on. Or any other stripped down version that will demonstrate the issue.

Do you mean all the messages in the folders? The virtual folder pulls messages from 2 different inboxes (Total 261,402 messages) which results in 18,674 messages.

Betterbird commented 2 days ago

Any data that will reproduce the issue. Since this appears to be a rule evaluation issue, one folder with 10 messages, a mix of read/unread and stuff from Groupon, Linkedin, Swagbucks, xyz and a few with(out) subject "you have been" should be sufficient.

viking2 commented 2 days ago

Any data that will reproduce the issue. Since this appears to be a rule evaluation issue, one folder with 10 messages, a mix of read/unread and stuff from Groupon, Linkedin, Swagbucks, xyz and a few with(out) subject "you have been" should be sufficient.

OK. May take some time to figure out... How do I prepare the folder with the messages to search on? Do I create a local folder and copy the messages there? What files do I send you?

Betterbird commented 1 day ago

We received a data sample that reproduces the issue. In fact, with the last two search terms, QF doesn't appear to have any effect, as looking for "huhu" just shows the content of the search folder unaltered: image

When the last two terms in the search folder definition are removed, QF works as it should. We'll debug the issue. At a guess, the additional QF condition is ORed to the existing term leaving the result unaltered.

Betterbird commented 10 hours ago

The virtual folder definitions communicated to us were: Non-working: terms=OR [status,isn't,read) AND [from,contains,Groupon) OR (from,contains,Linkedin) OR (from,contains,Swagbucks]] OR [from,doesn't contain,Groupon) AND (from,doesn't contain,Linkedin) AND (from,doesn't contain,Swagbucks) AND [from,doesn't contain,xyz) OR (subject,contains,you have]]

Working: terms=OR [status,isn't,read) AND [from,contains,Groupon) OR (from,contains,Linkedin) OR (from,contains,Swagbucks]] OR [from,doesn't contain,Groupon) AND (from,doesn't contain,Linkedin) AND (from,doesn't contain,Swagbucks]

To this we need to append the QF condition AND (from,contains,Groupon). Due to limitations in the term evaluation, an overall OR group becomes problematic when an AND term is appended. This needs further analysis.