mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 21:15:56 +03:00
[GH-ISSUE #1478] 🐛 [Bug] Message list in combined view is not showing expected messages #662
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#662
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @indridieinarsson on GitHub (Mar 23, 2025).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/1478
Originally assigned to: @mercihabam on GitHub.
🐛 Bug
The messages shown in the Everything view are not the correct ones. This applies at least for when using the "child processes" option.
I have several mail addresses, some with lots of traffic, some with less. When showing the first page of the "Everything" view, I would expect the messages to appear in chronological order, regardless of which server/mailbox they belong to.
That is not the case. Instead, it shows a few messages from each mailbox. The ones from my main address are all from today, but the mails from the less used addresses are from up to 6 days ago.
I did some research, and found the
flattenMessagesListsfunction to be the culprit. It is called from theHm_Handler_imap_combined_inboxhandler, with$maxPerSourceset to a fixed value of$maxPerSource = round($limit / count($data_sources));I think this is wrong, as we cannot know how many messages to take from each source before we have looked at the dates of the messages from each source.
Perhaps it would be better to fetch all the messages from the timespan selected for the combined view, sort all of them by date and serve up the appropriate part of the list, based on the listPage or offset parameters?
Page 1 of my everything stream:

Page 4 of my everything stream. Notice how all the messages are more recent than the oldest messages on the first page.

Version & Environment
Rev:
16b994a3eeOS: linux/docker
@marclaporte commented on GitHub (Mar 23, 2025):
@mercihabam any thoughts?
@mercihabam commented on GitHub (Mar 24, 2025):
That was intentional to allow users to see the list of messages both chronologically and in parallel. Ordering the list solely by date isn’t sufficient, as it could result in content from one mailbox dominating the view if it is significantly ahead of the others.
The current algorithm calculates the average number of messages per mailbox and distributes them evenly across pages. If a mailbox contains fewer messages than the average, additional content from a larger mailbox is displayed to balance the page.
@indridieinarsson commented on GitHub (Mar 24, 2025):
In my opinion, this could lead to confusion. A user with a use case similar to mine might have to page to the last page to see messages from today.
Let's say a user is confronted with the Everything page, on the first page, and sees a list of messages in chronological order, newest first, oldest at the bottom. I think it is plausible, or even likely, that this user expects the next page in the list to continue the chronological order of the first page, rather than starting with messages that are only slightly older than the newest one on the first page. I know I did, at least.
How was the behaviour in the old implementation, before paging was implemented?
@mercihabam commented on GitHub (Mar 24, 2025):
Not really what could happen, but I understand the behavior you're suggesting, and I'm fine with either option. If anyone else votes for your suggestion, we'll go for it.
@indridieinarsson commented on GitHub (Mar 24, 2025):
I just uploaded screenshots of my everything page in description of this issue.
On page 4, all the messages are more recent than the last message on page 1.
It may sound as a peculiar use case. But for me, I have one main address, where almost all the traffic is. Then a couple of other addresses where much less mail arrives. For me, monitoring all in one mailbox is the feature in Cypht, and what sets it apart from others webmail solutions.
@marclaporte commented on GitHub (Mar 24, 2025):
I don't see it.
@indridieinarsson commented on GitHub (Mar 24, 2025):
whoopsie, forgot to save. Here now (in description).
@indridieinarsson commented on GitHub (Mar 26, 2025):
One more thing. I tried adding in a couple of RSS feeds. Those are shown on the Everything page, but most entries are twice, and they are not sorted among the other messages. Instead, they all appear at the bottom of the page. If I page to page 2 and back to page 1, then each RSS "message" is shown twice, and the feed name (first column) is wrong.
@marclaporte commented on GitHub (Aug 27, 2025):
This is also the behavior I expect and is how it works in Cypht 1.4.x (which I still use until 2.5.x is released)
Using GitHub's milestone tool, I tagged this issue as a blocker for 2.5.0: https://github.com/cypht-org/cypht/issues/1624
@indridieinarsson There has been a massive amount of work in the last few months: https://github.com/cypht-org/cypht/commits/master/
Would it be possible for you to help us find issues like this in our test environment? (Making it much easier for devs to fix). We are also doing this related to a pagination issue: https://github.com/cypht-org/cypht/issues/1540
Thanks!
@indridieinarsson commented on GitHub (Aug 27, 2025):
@marclaporte
Yes, I have noticed the massive amount of work being done. I've been following from the sidelines, since I have been very busy with a "home improvement" project gobbling up all of my free time the past months.
The issue described here seems to be mostly solved, but I found one way to mess up the ordering of messages in the combined view (running master, commit
044c381cb5). To reproduce :The list then gets sorted correctly when you refresh the page.
@indridieinarsson commented on GitHub (Aug 27, 2025):
@marclaporte
Question : the behavior as I describe in last comment, is really a different one from the one described in the beginning of this issue. One might argue, this since the ordering is correct in the beginning, and becomes correct again upon refreshing, the issue is not a release-blocking one.
Should I close this issue as fixed (as the behaviour described in the original bug report is truly fixed) and make another one with the current behaviour?
@marclaporte commented on GitHub (Aug 27, 2025):
It's OK. Let's repurpose this issue for this last issue. I also noticed that "newly arrived messages are sorted at the end of the list, regardless of their age." Indeed not a blocker to the release, but let's try to solve.
@mercihabam Can you please try to reproduce?
@mercihabam commented on GitHub (Aug 29, 2025):
Sure, I'll give it a try ASAP. Thanks!
@mercihabam commented on GitHub (Aug 30, 2025):
Reproduced and fixed: https://github.com/cypht-org/cypht/pull/1649