Closed Bug 119404 Opened 23 years ago Closed 23 years ago

mail folders come up empty the first time that you open them

Categories

(SeaMonkey :: MailNews: Message Display, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.8

People

(Reporter: blizzard, Assigned: Bienvenu)

References

Details

(Whiteboard: [driver:blizzard] needs review)

Attachments

(1 file, 1 obsolete file)

Build is from Jan 10, 2002 off the tip.

The first time that I open a mail folder after I've created a new account or
I've created a mailbox it always comes up empty.  If I open another folder and
come back to that folder the messages in the new folder will show up in the
header pane.

Here's an easy way to test this:

1. Create a new subfolder.
2. Copy a message to that folder from one of your other folders.
3. Open the new subfolder.

The folder will come up empty until you open it a second time.

I also noticed this since I just blitzed my profile and I had to open every
single folder more than once on all my mail accounts.
You apparently have to have some filters to reproduce this reliably.  Here's a
way to reproduce this:

1. Send yourself a message that you know will be filtered into a subfolder.
2. Shut down the browser without getting new mail.
3. Delete the .msf file for the folder that the message will be filtered into.
4. Start the browser, bring up mail.
5. Get new mail and note that your message has been filtered.
6. Open the folder that your message is in.

On my system, the folder comes up empty.  Going to another folder and coming
back will cause the messages to show up.
Seth?  Bienvenu?  Any luck here?  This is making me nuts.
Blocks: 115520
why are you running into this so frequently? Are you always creating new
accounts or deleting .msf files? Or does this happen in other situations? If it
happens without creating new accounts or deleting .msf files, my guess would be
that you have duplicate .msf files for the same folder and we're getting
confused, e.g., folder.msf, folder-1.msf, folder-2.msf, etc. Deleting all the
.msf files and starting over would fix that latter problem, though of course,
you'd see the reported problem again.
I see this regularly on win2K. It happens to me several times a day. I have a
new profile and IMAP mail with many folders. I saw it jsut this morning on two
folders after first launch of mail with 2002011703 mozilla build. 
I'm not creating new accounts or new folders on a regular basis.  I've also
blown away all my .msf files a few times and this bug always shows up the first
time I open the folders after blowing away the files.

I'm _also_ seeing this on folders that I have definitely opened before.  Opening
them the first time just triggers it every time.  The two issues may or may not
be related.

As I've said in email I've also got folders that lose their thread state on a
regular basis but I'd rather deal with that in another bug so as not to confuse
the issue.

[ Changing OS to All since Asa reports this on w2k as well. ]
OS: Linux → All
there are several things going on here, but the main problem is that deleting
the .msf file like this is causing imap uid validity to change (the newly
created db, which replaces the one deleted, has a uid validity of unknown),
which makes us throw away the db (because it contains potentially invalid data),
which causes all the listeners on the db to be cleared out. One of these
listeners is the view code, which now will no longer get notified of new headers
downloaded and added to the db, so it will present an empty view.

We don't always run through this code, because in some situations, we short
circuit this process because we have no DB, and thus we think there are lots of
headers to download, so we wait until the folder is completely loaded before
building the view. So the root cause of this problem is that now we try to show
you the db contents in the thread pane before we've finished downloading all the
headers from the server. We could stop doing that, which wouldn't be popular, or
we could try to figure out some way of handling this uid validity change on the
fly. We could switch the listeners over to the new db (cringe), or we could
empty the db without deleting it (cringe), or we could somehow detect this case
in the front end and close and re-open the view when done. I'll think about it.
this might be related to #115228
I take it back, it's probably not related.
accepting, david and I have discussed (he talked, I listened) over AIM some
solutions, and he's going to start a patch. 

since this is muy malo, I'll work on this for 0.9.8
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.8
I was also able to reproduce this morning with a new filter I had set
up last night. I may have seen this more than once. 

I doubt if it is related to bug 115228 because that is about not able to find
destination filter folder. 
Target Milestone: mozilla0.9.8 → ---
Thank you so much for working on this.
Attached patch proposed fix (obsolete) — Splinter Review
so the fix is to make the view's db accessible read only, so the js code can
tell if the db somehow isn't set anymore (uid validity changing, or a corrupt
db, could cause this), and if so, we nee to rebuild the view.
Attached patch proposed fixSplinter Review
so the fix is to make the view's db accessible read only, so the js code can
tell if the db somehow isn't set anymore (uid validity changing, or a corrupt
db, could cause this), and if so, we nee to rebuild the view.
Whiteboard: [driver:blizzard]
I've been using this and it seems to work pretty well for what it's worth.
Whiteboard: [driver:blizzard] → [driver:blizzard] needs review
Comment on attachment 65490 [details] [diff] [review]
proposed fix

sr=sspitzer

blizzard, since you've tested it, want to do the r=?
Attachment #65490 - Flags: superreview+
Comment on attachment 65490 [details] [diff] [review]
proposed fix

r=blizzard

Looks good to me.
Attachment #65490 - Flags: review+
Comment on attachment 65490 [details] [diff] [review]
proposed fix

r=naving. looks ok
this is something we want for 0.9.8, setting milestone.

bienvenu is going on vacation today, so I'll land for him, but re-assign to him
so he gets the credit.
Assignee: sspitzer → bienvenu
Status: ASSIGNED → NEW
Target Milestone: --- → mozilla0.9.8
a=blizzard on behalf of drivers for 0.9.8
Keywords: mozilla0.9.8+
fixed.  thanks to bienvenu for the patch.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
*** Bug 115380 has been marked as a duplicate of this bug. ***
QA Contact: esther → laurel
OK using june5 commercial branch build: win98, linux rh6.2, mac OS 9.2
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: