Closed Bug 1843995 Opened 2 years ago Closed 1 year ago

sort order is sometimes flipped while using quick filter

Categories

(Thunderbird :: Folder and Message Lists, defect)

Thunderbird 115
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: mm23+bzla, Unassigned)

Details

Steps to reproduce:

  1. Open Inbox & show Quick Filter.
  2. Click date header to sort by date (recent first) & observe list order.
  3. Enter/select Quick Filter parameters & observe list order.
  4. Clear Quick Filter parameters & observe list order.
  5. Click date header to sort by date (recent last) & observe list order.
  6. Enter/select Quick Filter parameters & observe list order.
  7. Clear Quick Filter parameters & observe list order.

A. Further experiment with different folders and sort columns.
B. Test changing sort order while Quick Filter parameters are applied.

Name: Thunderbird
Version: 115.0
Build ID: 20230714121533
Distribution ID: archlinux

Actual results:

Step 2: Messages are sorted recent first.
Step 3: Messages are sorted recent first.
Step 4: Messages are sorted recent first.
Step 5: Messages are sorted recent last.
Step 6: Messages are sorted recent first.
Step 7: Messages are sorted recent last.

Test A: Some folders do not exhibit this unexpected behavior. Sorting by Subject and Correspondents columns also have this unexpected behavior.
Test B: Changes to sort order while a Quick Filter is applied give the expected sort order.

Expected results:

Results are as expected with the following exceptions:

Step 6: Messages are sorted recent last. (As selected before selecting Quick Filter parameters).

Test A: Applying a Quick Filter should not change the current sort order.

Soren, does this reproduce for you?

Flags: needinfo?(soeren.hentzschel)

I can't reproduce - the quick filter bar does not affect the sort order for me.

Flags: needinfo?(soeren.hentzschel)

I can sort of repro this, but only with the Unified Folder Inbox selected (Inbox itself, not a subfolder). And at step 6, I get messages sorted by correspondent which remains sorted by correspondent at step 7.
(Once this gets triggered, I can sometimes reproduce it even with newest at top until Thunderbird is restarted.)

Reporter does not mention which folders he's seeing this on.

Noting that I am testing this on Win10.

Possibly related to Bug 1827042 ?

The original test was on the Inbox folder for an imap account with ~1300 messages, ~800 unread. All messages synced locally, stored as mbox.

The bug occured with some folders but not all. There was no obvious correlation with folder message count.

Today I can't reproduce the bug with any real folders. Thunderbird is still the same build but has been restarted.

The bug does still occur in unified inbox, however the bug differs here in that sort order does not reset to the expected order when the quick filter parameters are removed. The bug continues to only flip the sort order of the expected sort column.

I observe the same bug with Thunderbird 115.1.1 (Gentoo, Thunderbird compiled from source via ebuild): quick-filtered messages are usually (but not always) shown in oldest-first order. Also, the UI shows a different sort order than the actual order of the emails.

The account is an IMAP account with tens thousands of messages in different folders. The inbox contains around 500 messages, most are unread. I don't think it matters but I have customized the message list columns as follows: thread, starred, subject, recipient, from, date, size, attachment. The quick filter

The messages are sorted recent first. When applying a quick filter, the messages are sorted oldest first despite the UI showing most-recent sort order (Date ^). Reversing the sort order on the date column reverses the visual indication (Date v) and the order of the messages remains oldest first (now consistent with the UI). Changing the sort order again to recent first now correctly reverses the list and the UI is consistent with the sort order (Date ^).

Similar to NQm9ezX, I am unable to consistently reproduce the error, but it appears that the problem occurs only if the messages are ordered most recent first when TB is started.

I'll attach a few screenshots to demonstrate:

  1. After TB startup. Threaded view, most recent messages first:
    https://pasteboard.co/JGhfP3UfXUzf.jpg
  2. After applying Quick Filter. Messages are ordered oldest first despite UI showing the opposite:
    https://pasteboard.co/HxYnn98LXIPS.jpg
  3. After reversing sort order by date in Quick Filter view. Messages are (still) ordered oldest first, UI is now consistent.
    https://pasteboard.co/Fb4VAttTh3gV.jpg
  4. Reversing sort order again (to most recent first) in Quick Filter view. Messages are now ordered most recent first, UI is consistent.
    https://pasteboard.co/b9nkCbGmi09q.jpg
  5. Clearing Quick Filter, back to main view. All good.
    https://pasteboard.co/UF4QUP6y2TvB.jpg
  6. Re-applying Quick Filter. Filtered messages are again in the wrong, oldest-first order and the UI is inconsistent.
    https://pasteboard.co/QpyzQ5rVm4gW.jpg

Again, this is not 100% reproducible - sometimes the message order is correct in the Quick Filter. It is, however, relatively easy to trigger the above behavior by switching the sort order in the main view and the filtered view a few times.

(In reply to NQm9ezX from comment #4)

The bug does still occur in unified inbox, however the bug differs here in that sort order does not reset to the expected order when the quick filter parameters are removed. The bug continues to only flip the sort order of the expected sort column.

I am not able to reproduce this with a current nightly build. Does it still reproduce for you?

Flags: needinfo?(mm23+bzla)

(In reply to Wayne Mery (:wsmwk) from comment #6)

I am not able to reproduce this with a current nightly build. Does it still reproduce for you?

I can not reproduce this bug as previously described with the following build:
Name Thunderbird
Version 115.6.1
Build ID 20240109183634
Distribution ID archlinux

..so in that sense it appears to be fixed.

However, the following search anomaly was found with a bit of manual fuzzing:

  1. Open a folder containing many threaded conversations and a diversity of names in the "Correspondents" column.
  2. Message threads off, no quick filter: sort by Correspondents works as expected.
  3. Message threads off, with quick filter applied: sort by Correspondents works as expected.
  4. Message threads on, no quick filter: sort by Correspondents works as expected.
  5. Message threads on, with quick filter applied: sort by Correspondents broken - somewhat sorted but some items scattered out-of-order.

I don't know if this is a different bug or not.

It is not reliably reproduced in all folders with threaded conversations. I have only found one folder where the newly described anomaly occurs: a local folder with ~1100 messages, mostly threaded conversations from an email list hosted by groups.io.

Another local folder of ~700 messages from the same email list (so a similar assortment of threads and correspondent names) did not exhibit this anomaly.

Folder[right-click] > Properties > Repair Folder -- did not change anything about this anomaly.

Flags: needinfo?(mm23+bzla)

Does "However" in comment 7 sound like a different bug? If so we can close this one.

Flags: needinfo?(steve)

(In reply to Wayne Mery (:wsmwk) from comment #6)

I am not able to reproduce this with a current nightly build. Does it still reproduce for you?

The bug seems to be fixed now. I have tried quick-filtering followed by sorting on several IMAP folders and it all looked correct.
TB version is 115.7.0, built from Gentoo's portage TB source package.

Thank you for fixing this!

Furthermore, I was unable to reproduce the bug in comment 7. The sort order with the quick filter looks somewhat unsorted because the threads are kept together and sorted by the first email in the thread.

Note: when sorting emails by date, the threads are ordered by the date of the last email in the thread which could be seen as a minor inconsistency, but I guess there is no way to make everybody happy. Personally, I think the current sort order (correspondents, recipient, from: sort by first mail in thread, date: sort by last mail in thread) is intuitively the correct order.

Thanks for the update.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Flags: needinfo?(steve)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.