Creating a large set of rules, switching midway from "and" to "or", and after error message "filter can not be saved because the terms are invalid in the current context"

NEW
Unassigned

Status

8 years ago
3 years ago

People

(Reporter: jpetrocx, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11

I have created a rather large (multiple criteria) for a rule.

I began to create the rule and after entering about 5 items, I switched from the "and" condition to an "or" condition.
When I attempted to save the rule I got an error message "filter can not be saved because the terms are invalid in the current context".

Yet the 2nd attempt to click "OK" did not produce the error message and it did save and update the filter.

HOWEVER, by chance I did look at the "msgFilterRules.dat" file and saw something very interesting - there were mixed "OR" and "AND" conditions.  I backed up the file and MANUALLY changed the "AND" conditions to "OR".

Now the filter works.  Yet, any attempt to add to the filter still produces the error "see above" the first time I click "OK" but then the second time I click "OK" the filter updates OK.

Here is a copy of the related part of the filter from the file AFTER I manually fixed the problem..............
*************************
ondition="OR (from,contains,hotwire) OR (from,contains,orbitz) OR (from,contains,priceline) OR (from,contains,travelocity) OR (from,contains,Delta) OR (from,contains,Aeroflot) OR (from,contains,AmericanAirlines) OR (from,contains,aa.com) OR (from,contains,northwest) OR (from,contains,southwest) OR (from,contains,lufthansa) OR (from,contains,AA net) OR (from,contains,USAir) OR (from,contains,Hotwire Deals) OR (from,contains,Away Network) OR (from,contains,deltaairlines) OR (from,contains,hotwire.com) OR (from,contains,Continental Airlines) OR (from,contains,NWA) OR (from,contains,airbaltic) OR (from,contains,airbaltic.lv) OR (from,contains,cheapair) OR (from,contains,cheapoair) OR (from,contains,sidestep) OR (from,contains,bookingbuddy) OR (from,contains,Farecast) OR (from,contains,Mileage Plus Partners) OR (from,contains,FareCompare) OR (from,contains,e-miles) OR (from,contains,ContinentalAirlines) OR (from,contains,Czech Airlines) OR (from,contains,Meridian Loyalty Program) OR (from,contains,aerosvit.com) OR (from,contains,info.united.com) OR (from,contains,tripadvisor.com) OR (from,contains,Air France) OR (from,contains,@greyhound.com) OR (from,contains,airbaltic.com) OR (from,contains,airfarewatchdog.com) OR (from,contains,@bt-store.com) OR (from,contains,mail.points.com) OR (from,contains,@points.com) OR (from,contains,klm-email.com) OR (from,contains,klm.com) OR (from,contains,balticmiles.com) OR (from,contains,milesORmore.com) OR (from,contains,flyfrontier.com) OR (from,contains,Travel Ticker) OR (from,contains,Frontier Airlines) OR (from,contains,Sherman's Travel)"
*************************

Reproducible: Always

Steps to Reproduce:
1.See summary above
2.
3.
Actual Results:  
See summary above

Expected Results:  
It seems to work OK

When changing from "AND" condition to "OR" condition I would expect that the change would occur globally and be reflected in future entries.

After manually changing the "AND" to "OR" it now does use the "OR" condition in future entries.  BUT - it still shows the error message (see above) the first time "OK" is clicked after the new entry is added.
You saw nothing in Tools -> error console when this happened ?

What version of Thunderbird are you using ?
Component: General → Filters
Product: Thunderbird → MailNews Core
QA Contact: general → filters

Comment 2

7 years ago
I can't reproduce this. All the operators change simultaneously to OR or AND as set in the UI.
Whiteboard: [CLOSEME 2011-01-01]

Comment 3

7 years ago
perhaps this depends on the error of bug 551707 occurring. If it does, then hopefully John's error can't happen.

so the test would be, can this be reproduce on version 3.1 (i.e. without bug 551707 fixed), AND, if it can, is there something worth fixing.
Depends on: 551707
Summary: Creating a large set of rules, switching midway from "and" to "or" & continuing error → Creating a large set of rules, switching midway from "and" to "or", and after error message "filter can not be saved because the terms are invalid in the current context"
Whiteboard: [CLOSEME 2011-01-01]

Updated

7 years ago
Duplicate of this bug: 705485

Comment 5

7 years ago
OK, after bug 705485 was reported I gave this another try.
STR:
1. In TB 11 I had a filter like this:
name="10 rules"
enabled="no"
type="17"
action="Move to folder"
actionValue="mailbox://pokus@server.sk/test3/test31"
condition="AND (subject,contains,xx) AND (from,contains,yyy) AND (subject,contains,zzz) AND (from,contains,zzzz) AND (from,contains,rwerwer) AND (from,contains,qwerwe) AND (from,contains,qwerqwer) AND (from,contains,2341234) AND (from,contains,1234234) AND (from,contains,12341234) AND (from,contains,12341234) AND (from,contains,12341234) AND (from,contains,tyfgh) AND (from,contains,dfghfgh) AND (from,contains,rtyrty) AND (from,contains,fghdfgh) AND (from,contains,yertyretyrt) AND (from,is,dfghdfgh) AND (subject,contains,122345)"

2. Then, I opened Filter list and Edit.
3. I toggled "match all of the following" to "match any of the following"
4. I inserted a new rule between (subject,contains,zzz) AND (from,contains,zzzz). It was the rule (subject,contains,122345).
5. Confirming this change, closing filter list.

Actual results:

condition="OR (subject,contains,xx) OR (from,contains,yyy) OR (subject,contains,zzz) OR (from,contains,zzzz) OR (from,contains,rwerwer) OR (from,contains,qwerwe) OR (from,contains,qwerqwer) OR (from,contains,2341234) AND (from,contains,1234234) AND (from,contains,12341234) AND (from,contains,12341234) AND (from,contains,12341234) AND (from,contains,tyfgh) AND (from,contains,dfghfgh) AND (from,contains,rtyrty) AND (from,contains,fghdfgh) AND (from,contains,yertyretyrt) AND (from,is,dfghdfgh) OR (subject,contains,122345)"

That rule (subject,contains,122345) is placed at the end is bug 392848. Notice it has the correct operator.

It is necessary to modify the filter (like add new rules) AND change the logical operator (AND<->OR) simultaneously, in one editing. It seems there are at least two bugs in the function rebuilding and storing the rule list.

So I confirm this now.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Hardware: x86 → All
You need to log in before you can comment on or make changes to this bug.