Closed Bug 1257826 Opened 9 years ago Closed 4 days ago

Incorrect sort order in unified folders using threaded view when sorted by "Received" (see comment #14)

Categories

(Thunderbird :: Folder and Message Lists, defect)

38 Branch
defect

Tracking

(thunderbird_esr115 wontfix, thunderbird_esr128? affected, thunderbird136 affected)

RESOLVED FIXED
Tracking Status
thunderbird_esr115 --- wontfix
thunderbird_esr128 ? affected
thunderbird136 --- affected

People

(Reporter: frommozilla.comhash69, Assigned: welpy-cw)

References

Details

Attachments

(5 files, 5 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0 Build ID: 20160303134406 Steps to reproduce: Set sort to: Received Descending Threaded Have at least 2 messages in a thread and have other message received during time between first and last threaded messages. Actual results: The thread shows at the bottom in unified view, but when switching to the original folder with exact same sorting, the thread shows on top. Expected results: Thread should be shown on top of the list, because the received date of the last message in the thread is newer.
Attachment #8732528 - Attachment is obsolete: true
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hmmm it seems it's indeed related to unified folder after all as I originally thought. What I'm getting right now is inconsistency in sorting in unified folder when order is changed in received column (non-unified folder sorts/order correctly as per your screenshot) So what I'm getting is when order is descending, changing it to ascending and then again to descending the thread sortes by most recent message. Changing order again to ascending and then back to descending sorts thread by oldest message. Repeat changing order will sort thread by most recent message again. And there it goes in the loop like that. If it makes any difference I'm using IMAP servers.
Confirmed on a local unified folder. When sorting by "Received" the sort order is wrong every second time. Screen shot coming.
Flags: needinfo?(mkmelin+mozilla)
Summary: Incorrect sort order in threaded view when sorted by "Received" → Incorrect sort order in unified folders using threaded view when sorted by "Received"
Once it works, and then it doesn't. Puzzling!
Attachment #8732496 - Attachment is obsolete: true
Attachment #8732529 - Attachment is obsolete: true
Attachment #8732530 - Attachment is obsolete: true
Attachment #8732533 - Attachment is obsolete: true
Summary: Incorrect sort order in unified folders using threaded view when sorted by "Received" → Incorrect sort order in unified folders using threaded view when sorted by "Received" (see comment #14)
Aceman, we have defined what is "right": When sorting by date or received, the sort order of a thread is the date or received of the most recent message. This is the current accepted behaviour (ignoring the discussion in bug 254159). The bug reported here is the following: When you have a *unified* folder and you change the sort order by received from descending to ascending and back, and to ascending again and back, you get different orders in the "descending" state (and maybe in the "ascending" state also, we haven't looked). On time the order is correct and another time the order is wrong, see attachment 8732537 [details]. Would you be interested in looking into it? Surely there is a line missing somewhere that does a reset on something ;-)
Flags: needinfo?(acelists)
(not good idea to have confirmed bug reports in Untriaged component)
Component: Untriaged → Folder and Message Lists
I'm surprised that such a serious bug has gone unfixed for two years. As the others I have sort order set to *received* *descending* and view set to *threaded* What I'm seeing is that the sort order of my unified inbox is only correct if I toggle threaded *off* then back on again. If I do not toggle the threading, then: * new incoming messages unrelated to a thread appear correctly at the top * new incoming messages related to an existing thread get positioned correctly within that thread, but the thread stays where it was, months or even years down. This is quite a serious problem because it means I am unlikely to see replies to threads that are more than a day or two old unless I remember to toggle off the threaded view and toggle it back on. A user who is unaware of this bug is unlikely to do this, and would therefore never see a substantial number of new incoming messages. This is with thunderbird 52.4.0 32 bit.
Same problem here!!! On TB 52.8.0. Why not fixed? I am losing mail sent to be as I do NOT see the replies. I have the ORIGINAL message I sent a replt to, and it might be 3 days ago. A reply comes in for my reply and folds in underneath that original message I replied to, but it is OFF the screen due to the length of time between the original I replied to. I can get the SORT to be correct by going to the menu bar and VIEW and SORT and selecting another sort and then clicking Received. Then the message list is SORTED properly. I have to do this EVERY time or I will lose sight on new replies. The reason I have to use this sort is due to my ISP poor handling of e-mails. I have Spectrum that was Brighthouse. They use RoadRunner for e-mail. However it first goes to the old Time Warner servers that Spectrum also owns and then sent to the servers with my ID on it. The DELAYS can be significant, especially for e-mail with the same CLF.RR.COM domain. Sometimes over 48 hours. So sorting on SENT also keeps the NEW e-mail way down the list and off-screen. At least with RECEIVED sort the original is on top (sort so the newest is on the top)and I get to see it no matter when sent. However this bug does cause me to MISS replies. PLEASE FIX...
Flags: needinfo?(acelists)
Severity: normal → S3

Irv, Harry, can you reproduce what is described in comment 17?

Flags: needinfo?(ispalten)
Flags: needinfo?(harry)

It still does happen.

I know this because I use MAILWASHER PRO that sees the incoming email. It sorts out the junk and they starts TB after is deletes 'spam/unwanted' emails. I can see the replies back and to be honest, I can read them in it, and even reply, but I wait for it to come into TB to reply.

Of course that specific email that causes this problem in TB is put under the original, with a '>' in front of the original, but is DOES NOT move the original up to the top where the reply time should be.

Now IF I had deleted the original (to Trash), the new reply would be in the correct spot in the list. All this is the list is threaded of course.

Since I use MailWasher though I know to look for it. If I didn't have that, I'd probably never see the replies and I'd never think to look for them.

This report is really old, I've learned to 'live' with it.

Flags: needinfo?(ispalten)

Irv, Harry, can you reproduce what is described in comment 17?

Yes I can. It's a bag of worms ... but that on its own is not very helpful so I've tried to come up with a logical explanation.

The problem seems to be very much related to threaded view: there is a very obvious (and more easily explained) difference in the way threaded messages are sorted, compared with unthreaded view:

Here's a comparison:

  • on the left is my default unthreaded view for my unified inbox, as seen when initially opening thunderbird
  • in the centre is the result of toggling to threaded view
  • on the right is the result of expanding all of the visible threads in the threaded view

Hmm, I don't seem to have permission to post images or attachments. There is more to say, but it will make no sense without the image.

Flags: needinfo?(harry)

Attached image TBsortOrder2

Compare threaded view on initial opening with result after turning threading off and back on again

Updated version of TBsortOrder2

To continue (see attachment first):

The three columns show the three different views of the topmost messages shown in my unified inbox.

I've highlighted two threads in green an yellow. There is one problem in both of them, which may not be immediately obvious, but I'll come back to that later.

I show three columns in the first image, but the full explanation needs a fourth column. For that, see https://bug1257826.bmoattachments.org/attachment.cgi?id=9467294

In that, the **Threaded **column is a repeat of the initial view when starting thunderbird and the other column is the result of turning threading off and back on again.

Both columns are the very top of my unified inbox so they should both be showing the newest messages. But here there's a major problem:

  • although the blue thread still appears, and contains the absolute newest message in the inbox, it's demoted to the bottom of the screenshot between two much older messages
  • the yellow thread is nowhere to be seen (actually it's buried another screen down, where I'm never likely to see it)

Looking back, there's a clue in that Initial Threaded view : although it has correctly positioned the thread for the newest message, it's showing the timestamp of the oldest message in that thread.

It seems to me that two essential changes are needed:

  • when viewing as threads, the position of the thread in the messages panel should always be determined by the newest message in that thread, and
  • when viewing threads, any thread which contains unread messages should always be expanded to show at least the unread messages, in bold.

[Updated the image -- use https://bugzilla.mozilla.org/show_bug.cgi?id=1257826 for the second comparison]

Aceman, we have defined what is "right": When sorting by date or received, the sort order of a thread is the date or received of the most recent message. This is the current accepted behaviour (ignoring the discussion in bug 254159).

In case it's not clear from my responses above (slightly confused by bugzilla's inability to paste images inline into the correct position in bug reports) the sort order in my tests above show that when viewing in descending order at least, threads are currently being sorted according to their oldest message, not the most recent message.

I, like Harry, understand the situation of where the reply goes, and that the primary initial email never moves based on when it was sent, and ALL NEW replies to it goes under (in the list) the original email and never moves up in the list. This makes it almost guaranteed not to be seen if the time between the initial and next email is more than a few minutes or so (like an email sent to many and replies to it are quick), however, long running emails between me and one other person, due to delays in replying will fall under the initial email well down in the list and not noticed as new.

I can see the way some might like it though and the problem it would create? Why is an OLD email up at the top of the list? Not noticing the little < on the left side indicating it is a thread?

There are many ways to mitigate this. All of course depending on how the uses had the email display choice, but the problem basically is for users with closed threading.

  • Bring the thread up into the list of emails only looking at the last email in the thread. Again, this will show dates out of order. However, force an open of the thread and it would be clear to the user why the original email was up in the list.
  • Bring the entire thread up to the proper spot depending on the LAST email, but MARK the thread (if closed) with either BOLD or ITALIC indicating a new reply in it.
  • Duplicate the email, the reply up top in sort order, and also below under the original email, and this could/should be an optional choice under VIEW THREADING probably.

Still, to me, the real problem is SEEING a reply to an email when the old initial email is fairly old and down the list of view with the new emails.

When a message header is added to a threaded search db view, its thread is moved to the right place if the view is sorted by date and the message is the newest in that thread. The same happens if the sort order is changed, since the view is rebuilt in this case. Unfortunately this mechanism wasn't enabled when sorting by date received.

Assignee: nobody → h.w.forms
Status: NEW → ASSIGNED

(In reply to Hartmut Welpmann [:welpy-cw] from comment #32)

Created attachment 9467839 [details]
Bug 1257826 - Fix Sort by Received for search db views. r=#thunderbird-reviewers

When a message header is added to a threaded search db view, its thread is moved to the right place if the view is sorted by date and the message is the newest in that thread. The same happens if the sort order is changed, since the view is rebuilt in this case. Unfortunately this mechanism wasn't enabled when sorting by date received.

================

Well, I use Date Received as I've gotten too many where the clock was wrong on the sender's PC or server where it was auto-generated, causing me NOT to see the email.

So the code should be added to Date Received as a 'quick fix', no? Most of the time the difference between the 2 columns is no different, but there are some minutes to over and hour apart, and I've seen some a day or more, and a few random ones YEARS different.

(In reply to Irv Spalten from comment #33)

Well, I use Date Received as I've gotten too many where the clock was wrong on the sender's PC or server where it was auto-generated, causing me NOT to see the email.

So the code should be added to Date Received as a 'quick fix', no? Most of the time the difference between the 2 columns is no different, but there are some minutes to over and hour apart, and I've seen some a day or more, and a few random ones YEARS different.

Even assuming the every sender's clocks are correct, Date Received is the safer sort order -- because email can be delayed by hours or even days in transit, especially if the receiving ISP's mail server is overloaded with a lot of spam.

(In reply to Harry from comment #34)

Even assuming the every sender's clocks are correct, Date Received is the safer sort order -- because email can be delayed by hours or even days in transit, especially if the receiving ISP's mail server is overloaded with a lot of spam.

Oh, I agree. I've used the CTRL-U to look at the source.

Here is one from Office Depot... TB lists it as Received @ 2/19/2025 11:23PM and Sent @ 2/18/2025 2:23PM. 1 day and 9 hour difference.

In the SOURCE I see this for SENT --> Date: Tue, 18 Feb 2025 19:23:00 +0000
I see this as RECEIVED --> Thu, 20 Feb 2025 04:23:03 +0000

The email itself contains "Date: Tue, 18 Feb 2025 19:23:00 +0000" as the date, but it was sent later it seems.

My timezone offset is -5 so RECEIVED is correct. SENT as well. So the delay was somewhere in between it seems.

It appears my ISP got it directly from Office Depot as well. No intermediately servers listed?

======================
Received: from p-impin014.msg.pkvw.co.charter.net ([47.43.26.155])
by p-mtain002.msg.pkvw.co.charter.net
(InterMail vM.9.01.00.037.1 201-2473-137-122-172) with ESMTP
id <20250220042304.KLTD3696.p-mtain002.msg.pkvw.co.charter.net@p-impin014.msg.pkvw.co.charter.net>
for <ispalten@xxx>; Thu, 20 Feb 2025 04:23:04 +0000
Received: from r211.em.officedepot.com ([20.57.66.211])
by cmsmtp with ESMTP
id ky5XtEXluyc4Uky5Xt942a; Thu, 20 Feb 2025 04:23:03 +0000
X-ORIG-RCPT: ispalten@xxx

Pushed by alessandro@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/022d28b4be01
Fix Sort by Received for search db views. r=tobyp

Status: ASSIGNED → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: