Closed Bug 569065 Opened 14 years ago Closed 13 years ago

Opens wrong email for first 3 emails try to open in folder

Categories

(MailNews Core :: Networking: IMAP, defect)

1.9.2 Branch
x86
Windows Vista
defect
Not set
major

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: u285848, Unassigned)

References

(Depends on 2 open bugs)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.4) Gecko/20100529 Lanikai/3.1.1pre

For some reason randomly this morning, all of the gmail I try to open via search, email preview, double-clicking, regardless of entry point opens a the wrong email message (the same one). However, other email accounts in same instance open of TB open the correct email. In webbased gmail for same account, the correct email opens up.

Reproducible: Always

Steps to Reproduce:
1. Try to open or preview an email with one of the accounts.

Actual Results:  
It opens the wrong email (the same one, regardless of which email I open in that account).

Expected Results:  
Expect it to open/preview the correct email when I open/preview it.

Can reproduce after restarting TB. Happens in latest stable 3.0 version (3.0.6) and nightly build from this morning of TB 3.1.
Attached screenshot showing the wrong email subject and content showing for the selected email. I confirm this happens for all emails attempted to open via that email account. Going to other accounts in same instance, email opens properly. Go back to original account and it continues to open up wrong email. Tried restarting TB and was able to reproduce.
(In reply to comment #1)
> screenshot of wrong email open

POP3? IMAP?
Which view do you use at folder pane? "All Folders"?

Which mail is displayed at message pane(called preview pane by MS)?
Mail you viewed just before you click the mail highligt'ed at thread pane?
Or mail irrelevant to your previous operation before your problem occurs?
You say problem occurs on all mails in your Inbox of only one account.
When other mail is clicked, what happens at message pane?
 - Still same wrong mail
 - Other wrong mail is shown
 - Correct one is shwn
What is shown by View/Message Source? wrong mail data? or correct mail data? 
Does problem occur on some other mail folders? Or it was Inbox only

Show "Order Received" column at thread pane(UID if IMAP, offset in mail folder file if POP3 or Local Folders). Something funny(e.g. very large number) is seen?
Sort by "Order Received" column and "Date" column. Position of recent mails are roughly placed at near position at thread pane(if ascending, recent ones at bottom) by both sorting?
After more checking it appears that it is only the top 3 or so most recent emails in each folder that are opening up an old irrelevant email in that folder. If a different folder is chosen the top 3 messages show a different old irrelevant email specific for that folder.

View/Message Source shows wrong mail data (mail data for the irrelevant email).

Problem happens in Inbox and other folders.

Order received number doesn't look funny for any email (I scrolled through all of them).

Ordered by Order Received and Date and the email and irrelevant email were not close at all. The irrelevant email is #588 (IMAP) 2008/10/06 10:35 AM and the email I selected was 5851 (today) 12:28 AM.

This continues to happen- as I get new email, only the top 3 newer emails in the folder have the issue. I turned off all extraneous add-ons and restarted TB but have same issue.
> The irrelevant email is #588 (IMAP) 2008/10/06 10:35 AM

Is it mail of smallest UID in the Inbox folder? 

How big is you Inbox folder? If not so big, check next please.
(1) Save #588(IMAP) to .eml file for ease of further analysis.
(2) Terminate Tb
(3) Keep backup of ...\ImapMail\<your_imap_sever>\Inbox and Inbox.msf.
    Copy ...\ImapMail\<your_imap_sever>\Inbox to
    ...\Mail\Local Folders\IMAP-Inbox
    What is file size?
(4) Restart Tb, show "Order Received" column of IMAP-Inbox(offset in file).
    What value is shown for mail of #588(IMAP) in IMAP-Inbox?
    Is mail of #5851(IMAP) seen in IMAP-Inbox?
(5) At Inbox of IMAP account, Folder Property/General/Rebuild Index,
    and wait for auto-sync(open Tools/Activity manager).
    Is #5851(IMAP shown correctly?
It isn't the smallest "Order Received" of the mails in the folder. Also, I'm confused as to why it would be the UID for an IMAP folder, because there are a few emails here and there that have the same order received. I see many emails that have an "Order Received" under 1000 that happen to have the same order received #. For example I have two emails with "Order Received" 966 that have two different subjects, two that have "Order Received" 965 that have two different subjects, etc. 588 happens to be one of these. The suspicious thing here is that, for example, there is a 968 with date 2008/12/18 and another 968 with date 2010/05/28. I'm guessing this has something to do with the issue, especially if order received is being considered synonymous with UID, because it isn't a unique ID, at least not in my folder.

However, what you said to do revealed some strange stuff. Copied INBOX and INBOX.msf of the specified imap server folder (which I had to identify using folders that were specific to that account that just happened to be in there). Restarted TB, viewed the Inbox local folder, adding the Order Received column again. Now the highest order received I received before noticed the issue) is 320509534 (previously in old folder it was #5825). The email that was 588 previously is 0. On top of that, the newer emails (everything after #5825) are gone/lost, confirmed also by attempting to sort on date in local folder (there is nothing newer than 320509534 (previously #5825).

Indexing is taking forever. Will let you know what that does.
Summary: Opens wrong email for every email try to open in one account → Opens wrong email for first 3 emails try to open in folder
(In reply to comment #5)
> Also, I'm confused as to why it would be the UID for an IMAP folder,
> because there are a few emails here and there that have the same order received.
> I see many emails that have an "Order Received" under 1000 that happen to have the same order received #.
> For example I have two emails with "Order Received" 966 that have two different subjects,
> two that have "Order Received" 965 that have two different subjects, etc.
> 588 happens to be one of these.
> The suspicious thing here is that, for example, there is a 968 with date 2008/12/18
> and another 968 with date 2010/05/28.
> I'm guessing this has something to do with the issue,
> especially if order received is being considered synonymous with UID,
> because it isn't a unique ID, at least not in my folder.

It sounds similar phenomenon to Bug 414723/Bug 501392(fixed by Tb3.0b3).  
> Bug 414723 Duplicate messages appearing in list, and some messages not appearing (IMAP)
> Bug 501392 Duplicates messages (or missing messages) in IMAP
If above bug happens, different mail data is saved with same UID in IMAP folder.

Anyway, "Order Received" column value of IMAP folder is UID of mail at IMAP servr, but "Order Received" column value of IMAP-Inbox under "Local Folders" is offset of mail data in copied local mail folder file(==offset in offline-store file for IMAP folder). It sufficienly confuses me. Please wait for a while until I undertand your report.

> Indexing is taking forever. Will let you know what that does.

Which indexing?
a) Indexing by Gloda(Global Search and Indexer) 
b) Indexing for .msf(mail summary file, Folder Properties/General/Rebuld Index)
If a), can you disable "Global Search and Indexer"(Tools/Options/Advanced/General) for ease of problem analysis?
I'm running the Folder Properties/General/Rebuld Index indexing you asked me to. It is making progress but still working on it...
(In reply to comment #5)
> Now the highest order received I received before noticed the issue) is
> 320509534 (previously in old folder it was #5825).
> The email that was 588 previously is 0.
> On top of that, the newer emails (everything after #5825) are gone/lost,
> confirmed also by attempting to sort on date in local folder
> (there is nothing newer than 320509534 (previously #5825).

It sounds same phenomenon as Bug 501851 and/or Bug 542723.
> Bug 501851 If appending to IMAP offline-store file is interfered with other software,
> mail data at offset=0 in offline-store(length=102,256 bytes) is used as mail data
> Bug 542723 (Tb 3.0.1) If appending to IMAP offline-store file is interfered by other software,
> mail copy/move to the IMAP folder silently fails
> ([nsIMsgCopyService.CopyMessages] nsresult:0x80004005)

What is file size of saved .eml file? Is .eml file content complete mail data? Shorter or longer than it should be?
Confirming, based on analysis on data in offline-store file by bug opener.
Status: UNCONFIRMED → NEW
Component: General → Networking: IMAP
Ever confirmed: true
Product: Thunderbird → MailNews Core
QA Contact: general → networking.imap
Version: unspecified → 1.9.2 Branch
According to Vista SP3 the .eml file that was #588 has the following size:
Size: 4.80 KB (4,925 bytes)
Size on disk: 8.00 KB (8,192 bytes)

Opening the email in source shows that the email (the HTML mime part) was cut short.

The indexing never finished, so I will disable "Global Search and
Indexer" (Tools/Options/Advanced/General) and try again. Thanks!

So if this is the bug you mentioned, how can I fix? Will reindexing in latest build fix it?
(In reply to comment #10)
> According to Vista SP3 the .eml file that was #588 has the following size:

Next should have been (1) Save #5851(IMAP) ... 
> (1) Save #588(IMAP) to .eml file ...

> Opening the email in source shows that the email (the HTML mime part) was cut short.

Is it for #5851(IMAP) when problem occurred at Inbox of IMAP?

> So if this is the bug you mentioned, how can I fix?
> Will reindexing in latest build fix it?

Yes. Both of "dup'ed UID" and "wrong mail data" is generated upon download of mail data due to bugs. Both are timing dependent problems. (see bugs I pointed, please) So, re-fetch resolves problem, unless problem happens again during re-fetch.
Next is possible;
  Move or copy corrupted mails to other IMAP folder, then move back.
  By this, new UID is assigened and mail data is downloaded.
But you have multiple corrupted mails due to different problems. So, I recommended you to do rebuild-index which forces redownload of all mails.
> It sounds similar phenomenon to Bug 414723/Bug 501392(fixed by Tb3.0b3).  
> > Bug 414723 Duplicate messages appearing in list, and some messages
> > not appearing (IMAP)
> > Bug 501392 Duplicates messages (or missing messages) in IMAP
> If above bug happens, different mail data is saved with same UID in IMAP
> folder.

This bug can't depend on or caused by bug 414723 or bug 501392, because these are fixed and this one here is not.
Please don't randomly mark dependencies based purely on suspicion of relation.
No longer depends on: 414723, 501392
Fortunately or unfortunately, this bug has gone away, probably due to reindexing? I'm sorry. Thanks for your help. BTW- I meant that I'm using 3.0.4 vs. 3.0.6 above.
(In reply to comment #12)
> This bug can't depend on or caused by bug 414723 or bug 501392, because these
> are fixed and this one here is not.

Have you really read this bug well and understood problems involved in this bug?

(Comment #5 by bug opener.)
> Also, I'm confused as to why it would be the UID for an IMAP folder,
> because there are a few emails here and there that have the same order received.
> I see many emails that have an "Order Received" under 1000 that happen to have the same order received #.
> For example I have two emails with "Order Received" 966 that have two different subjects,
> two that have "Order Received" 965 that have two different subjects, etc.
> 588 happens to be one of these.
> The suspicious thing here is that, for example, there is a 968 with date 2008/12/18
> and another 968 with date 2010/05/28.

As date of #968 is 2008/12/18, date of duplicated #966 is around 2008/12.
Bug 414723 was changed to FIXED on 2009-06-03.
Bug 501392 was changed to FIXED on 2009-07-06.
I think the duped UID problem didn't occur after bug opener started to use Tb 3.0, but there is no evidence that duped UID problem didn't occur after it. Before checking of it, I tried to check about the existent mails of duped UID in bug opener's mbox. Please note that DUPing this bug to that bug is possible and permitted action, as two kind of problems are involved in this bug. Xrefing befoe such action is inhibited at B.M.O?

> Please don't randomly mark dependencies based purely on suspicion of relation.

Please don't bother problem analysis work, without reading bug well.
Unfortunately, this bug has occurred again. :( I just installed TB 3.1 RC1 and right-clicked on all folders under each account affected Properties -> Repair Folder, which I assume is how to rebuild index, and see in Activity Manager that it is done reindexing, but when I tried to open most recent emails, it opens that old unrelated email again. :( ! Thanks in advance for any advice.
So now (in 3.1 RC1) order received 5957-5962 will open order received 588 which is now at the bottom of the list in the full search folder that I'm using as a favorite to see all sent/etc. mail at once. (It isn't the oldest email, so it looks like it "lost" email in the search folder even though I know older email is still there is gmail imap and is there in the inbox folder in TB.) When I try to open the top emails in the Inbox folder (not search folder) it is also opening the irrelevant email.
Let me know if there is a way to do a global reindexing/rebuild of all folders and accounts. That seems like it would be helpful.
Please use "All Folders" view. Viewing of mails in multiple mail folder at same time easily produces confusion. Check mails in single real mail folder.
Is #588 samalles UID in a mail folder? Is 5957-5962 largest UI in the mail folder? Can you see DUP'ed UID in a real mail folder(with "All Folders" view)?
Gary?? ...

(In reply to comment #18)
> Please use "All Folders" view. Viewing of mails in multiple mail folder at
> same time easily produces confusion. Check mails in single real mail folder.
> Is #588 samalles UID in a mail folder? Is 5957-5962 largest UI in the mail
> folder? Can you see DUP'ed UID in a real mail folder(with "All Folders"
> view)?
I apologize for not commenting earlier. I was a little frustrated because at the time it still wasn't working.

I have not run into this issue recently, so it is either fixed or is not affecting me with the IDs of the emails I'm reading.

Feel free to close, and will comment back here if I have problems again. It would be nice if I could have produced enough information to ensure there could be a test to try to keep this from happening to anyone else in future builds, but all I know was that it didn't happen with every email, but that certain emails would open the wrong email when I attempted to open them (and this issue also appeared to delay opening of the incorrect email).

Thanks again for your help and follow-up. Marking as resolved, I guess.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
WFM is appropriate for bugs where we don't know what fixed it/changed the behavior.
Resolution: FIXED → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: