Closed Bug 97530 Opened 23 years ago Closed 23 years ago

Filter disables in this case of rename destination folder - exit after rename.

Categories

(MailNews Core :: Filters, defect)

defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.5

People

(Reporter: laurel, Assigned: naving)

Details

(Whiteboard: PDT+)

Attachments

(2 files)

Related bug 41720

Using aug29 commercial trunk build: win98, linux rh6.2, mac OS 9.0
Happens for IMAP or POP filters/folders

The fix for bug 41720 made it so that filters would work after renaming a folder
which was involved as a filter destination. That works when the rename takes
place in the same session as getting/filtering a new message.  The scenario
below causes filter to be disabled and therefore the message doesn't get moved
to the intended destination folder.

Steps:
1.   Set up a simple filter on POP or IMAP account with an action to Move To
Folder.  Specify a folder (top level or sub) on that same account as the
destination for the filter action.  
2.   Send yourself a message which will match the filter criteria, get the
message and verify it is indeed moved to the destination folder properly.
3.   Rename the destination folder.
4.   Exit, then launch to mail, login to the account and send yourself a message
which will match the filter criteria.
5.   Get that message and note it is not moved from the inbox. 
6.   Check the filter dialog and note the filter has been disabled.
Status: NEW → ASSIGNED
This is happening because we are not able to get the filter service during 
shutdown. Looks like we release the service manager and then try to get the 
filterService so we get ns_errror_failure and null. I will work on the fix.  
Attached patch proposed fixSplinter Review
The current code tries to save the filter list in the nsMsgIncomingServer 
destructor. Well that is not very safe, if there is leak it will never be
called, there could be other cases besides this bug where filterlist may never
gets saved. 

So, I moved it to account manager code and upon exit we now save
the filter list. This is the correct way of doing it.

cc sspitzer and cavin for review. 
r=cavin.
cc bienvenu for sr. 
if I understand correctly, when you rename the folder, we adjust the filter,
right? If that's the case, you should be saving the filters at that point.
Moving the filter saving code around won't fix the problem if you crash after
renaming the folder.
we can also save just after renaming, but we will still need this patch to
save any other session changes. We do save on New filter and Edit Filter...
I cannot think of any other situation right away.

I think I'm not being really clear - we should always save when something
changes about the filters - the save in the destructor was just a temporary
catch-all because originally the filter editing code did not save the filters at
all.
Attached patch proposed fix, v2Splinter Review
looks good, sr=bienvenu
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
This scenario working OK with sep5 commercial trunk build: mac OS 9.0, linux
rh6.2 and win98. 
Any other scenarios found to be a problem involving renaming and filters will be
logged separately.
Status: RESOLVED → VERIFIED
Reopening... this fix never made it to the branch and is needed to make fix for
bug 98391 (and bug 41720) work effectively on the branch.

Status: VERIFIED → REOPENED
Keywords: nsbranch
Resolution: FIXED → ---
Unfortunately it's a bit late in the game to be trying to take this fix. If we
tried last week I'm sure we could have gotten it in. I'll try to take it to PDT
but I'm not hopeful.
Keywords: nsbranchnsbranch+
Target Milestone: --- → mozilla0.9.5
check it in - PDT+
Whiteboard: PDT+
fixed on branch
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
OK using sep26 commercial 0.9.4 build: win98, linux rh6.2, mac OS X
Status: RESOLVED → VERIFIED
removing link to this fixed bug from mozilla 0.9.6 release notes.
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: