-
-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index: fix cursor after new mail #3560
base: main
Are you sure you want to change the base?
Conversation
didn't work for me for the specific issue i'm seeing:
i expect that i would remain where it was. instead, the message "New mail in this mailbox" is displayed, and the cursor position is lost/non-existent. pressing |
c4e7abc
to
13bc12e
Compare
Why do the same unchanged commits keep getting force pushed? |
Ah! That's me |
94adae9
to
8b574fa
Compare
The latest push appears to fix the issue for me. I'm installing it on my main client and will let you know if it has any problems. Thank you! |
does not fix it for me. i'm in a limited view, and when i get the notification "new mail in inbox", i still loose my current cursor position. my limited view did not include the new message. my configure (on debian 11.6):
|
Thanks for the feedback ❤️ I spent the day working on this and made some progress, but I'm not done yet. There are eight test cases, combinations of:
|
Oh, using a limit breaks both index and pager by setting cursor to an invalid message, and closes pager. This happens for new messages inserted at top or bottom, matching or not matching the limit. Using inotify. |
New patch fixed the broken cursor after receiving new mail, but pager is still closed when new mail arrives before or after the cursor when a limit is set. It also introduced some new bugs. Closing pager or changing messages after any mail as arrived does not mark message as old. Switching to another message or opening and closing pager again will mark the message as old. I think the messages are being marked as old in the UI but not in the backend, and a refresh switches them back to new. So the next two bugs might only happen when messages are new or recently marked as old with no other actions that could sync them to the backend. Receiving mail while in index or pager causes all old messages to be marked as new, and shows "Mailbox was externally modified". While in pager, receiving mail before the cursor marks current message as old, updates the index so current message shifts down one, and then marks current message as new. |
Why was this pushed to main in 2523464? |
@flatcap |
4be097e
to
268e182
Compare
922006b
to
5923c35
Compare
97b0177
to
511fc2e
Compare
89a6426
to
582c545
Compare
16a7ab0
to
8e738c1
Compare
5bb797f
to
408923d
Compare
4efe8ea
to
64aacee
Compare
2f04c90
to
1445cc4
Compare
Update: I've fixed some problems, but the issue with
<limit>
remains.Unfortunately, there isn't going to be a quick-fix for that.
When new mail arrives, the backends (maildir/imap) update the Mailbox and send notifications.
In the frontend, the Mailbox view (
MView
) observes these changes (mview_mailbox_observer()
).(
MView
was previously known as theContext
)Before we do anything that might affect the ordering of the
Email
s, remember the sequence number of the currentEmail
.Afterwards, search for the
Email
by the sequence number.Fixes: #3544