#70 meli gets stuck on `set seen' for mail (threads) at random

Open
opened 4 months ago by oblitum ยท 23 comments
oblitum commented 4 months ago

There's one mail thread, which I can't `set seen' so this folder's box can't
reduce the counter because of that. I think, if I restart meli and go straight
to this folder and set seen for these emails, then it will get read, but not
doing it right away, it gets stuck, even going inside thread and trying read
each email, it doesn't work.

When this happens, after I execute `set seen', meli gets two colored lines at
the bottom of screen, orange and red, and it's stuck there for quite long time
then it simply goes away.

I've noticed that sometimes when that happens, if I have meli closed much later,
when opening it again, the emails have been already `set seen' and the folder counter is zeroed.
So it seems that
meli was in some broken state formerly where it didn't update to the real state
of the mails / folder.

#imap

There's one mail thread, which I can't `set seen' so this folder's box can't reduce the counter because of that. I think, if I restart meli and go straight to this folder and set seen for these emails, then it will get read, but not doing it right away, it gets stuck, even going inside thread and trying read each email, it doesn't work. When this happens, after I execute `set seen', meli gets two colored lines at the bottom of screen, orange and red, and it's stuck there for quite long time then it simply goes away. I've noticed that sometimes when that happens, if I have meli closed much later, when opening it again, the emails have been already `set seen' and the folder counter is zeroed. So it seems that meli was in some broken state formerly where it didn't update to the real state of the mails / folder. \#imap
epilys commented 4 months ago
Poster
Owner

I've pushed some microfixes these past few days, which could cause this behavior. I'll keep a lookout if this happens to me from now on, and if you confirm it as well we can consider it fixed for now.

I've pushed some microfixes these past few days, which could cause this behavior. I'll keep a lookout if this happens to me from now on, and if you confirm it as well we can consider it fixed for now.
oblitum commented 4 months ago
Poster

Read state has been quite flaky for me. Sometimes the folder mail counter is zero while there's still unread emails, sometimes I set seen and they don't update state, sometimes the email is shown as read but then the counter doesn't update, etc.

Read state has been quite flaky for me. Sometimes the folder mail counter is zero while there's still unread emails, sometimes I set seen and they don't update state, sometimes the email is shown as read but then the counter doesn't update, etc.
oblitum commented 4 months ago
Poster

Often I'm seeing mail counters act strangely. One thing that often happens is just after opening meli it simply won't update/display any folder mail counters, but when I browse the folders, they have unread emails. Another thing is that sometimes some folder counter will suddenly display a count of all the emails in the folder instead of just unread ones.

Often I'm seeing mail counters act strangely. One thing that often happens is just after opening meli it simply won't update/display any folder mail counters, but when I browse the folders, they have unread emails. Another thing is that sometimes some folder counter will suddenly display a count of all the emails in the folder instead of just unread ones.
epilys commented 4 months ago
Poster
Owner

Does the server support LIST-STATUS/CONDSTORE? Does deleting the header cache do any difference?

Does the server support `LIST-STATUS`/`CONDSTORE`? Does deleting the header cache do any difference?
oblitum commented 4 months ago
Poster

@epilys I'm using gmail accounts and dovecot imap server, this happens in both cases. How to check for LIST-STATUS/CONDSTORE? I don't see any error in trace.log regarding that, all I see is M3 OK Success, "M3 OK Enabled", etc after sent: M3 ENABLE CONDSTORE.

On header cache, I'm gonna delete it and see how it behaves in the following hours/days.

@epilys I'm using gmail accounts and dovecot imap server, this happens in both cases. How to check for `LIST-STATUS/CONDSTORE`? I don't see any error in `trace.log` regarding that, all I see is `M3 OK Success`, `"M3 OK Enabled"`, etc after `sent: M3 ENABLE CONDSTORE`. On header cache, I'm gonna delete it and see how it behaves in the following hours/days.
oblitum commented 4 months ago
Poster

Right after deleting cache and restarting meli, it didn't update folder mail counters, even though it was listing new emails. After restarting meli it updated the counters.

Right after deleting cache and restarting meli, it didn't update folder mail counters, even though it was listing new emails. After restarting meli it updated the counters.
epilys commented 4 months ago
Poster
Owner

I will play around with an IMAP account and see if I can get it reproduced and report back. ๐Ÿ™ƒ

I will play around with an IMAP account and see if I can get it reproduced and report back. ๐Ÿ™ƒ
oblitum commented 4 months ago
Poster

Confirming that I'm still getting mail count jump from unread to all-mails. Seems to happen after new mails arrive. Restarting fix the counter.

Confirming that I'm still getting mail count jump from unread to all-mails. Seems to happen after new mails arrive. Restarting fix the counter.
oblitum closed this issue 4 months ago
oblitum reopened this issue 4 months ago
oblitum commented 4 months ago
Poster

Sorry, closed issue by accident.

Sorry, closed issue by accident.
epilys commented 1 month ago
Poster
Owner

Pushed some commits that try to fix the counting logic, since it's been a while I will close this issue and we can re-open it if it's still there

Pushed some commits that try to fix the counting logic, since it's been a while I will close this issue and we can re-open it if it's still there
epilys closed this issue 1 month ago
epilys commented 1 month ago
Poster
Owner

Reopening since it was mentioned on IRC that this still keeps happening.

Reopening since it was mentioned on IRC that this still keeps happening.
epilys reopened this issue 1 month ago
epilys commented 1 month ago
Poster
Owner

It seems to me that in set_flags(), when STORE FLAGS is succesful, we can return the refresh events from there immediately instead of relying on getting the update from the server.

It seems to me that in set_flags(), when `STORE FLAGS` is succesful, we can return the refresh events from there immediately instead of relying on getting the update from the server.
epilys commented 1 month ago
Poster
Owner

However, that'd mask the real problem: not getting updates on flag change events (or possible all events). Do you get refresh updates when changing flags or getting new mail or removing mail from other clients? If not, does it happen after at most 3 minutes?

However, that'd mask the real problem: not getting updates on flag change events (or possible all events). Do you get refresh updates when changing flags or getting new mail or removing mail from other clients? If not, does it happen after at most 3 minutes?
epilys added the
bug
label 1 month ago
epilys added the
IMAP
label 1 month ago
oblitum commented 1 month ago
Poster

I used aerc for quite a while and hardly hit this. Can't remember the mutt experience as it was too long ago. FWIW, nothing changed on meli regarding this, don't you experience it at all? I use meli daily but at the moment I don't expect it to obey me, it doesn't matter which account type, gmail or not, it often don't get these counters right, and also often I set seen multiple times for an email but it gets stuck as unread in the UI.

I used aerc for quite a while and hardly hit this. Can't remember the mutt experience as it was too long ago. FWIW, nothing changed on meli regarding this, don't you experience it at all? I use meli daily but at the moment I don't expect it to obey me, it doesn't matter which account type, gmail or not, it often don't get these counters right, and also often I set seen multiple times for an email but it gets stuck as unread in the UI.
oblitum commented 1 month ago
Poster

Ah, yeah, I use K9 on LineageOS and have zero problems.

Ah, yeah, I use K9 on LineageOS and have zero problems.
epilys commented 1 month ago
Poster
Owner

I used aerc for quite a while and hardly hit this.

EDIT: I think you misunderstood my question, I meant that if you make changes from other clients, do they show up on meli?

don't you experience it at all?

I haven't had it happen to me (set sth seen and never get any feedback on it) and I've been testing regularly with 3 different mail servers including Gmail. Which is why this is puzzling for me.

> I used aerc for quite a while and hardly hit this. EDIT: I think you misunderstood my question, I meant that if you make changes from other clients, do they show up on meli? > don't you experience it at all? I haven't had it happen to me (set sth seen and never get any feedback on it) and I've been testing regularly with 3 different mail servers including Gmail. Which is why this is puzzling for me.
epilys commented 1 month ago
Poster
Owner

Some thought I just had: is the counter in the status bar on the bottom updated or is it just the counter in the menu?

Some thought I just had: is the counter in the status bar on the bottom updated or is it just the counter in the menu?
epilys commented 1 month ago
Poster
Owner

If it's just the counter on the sidebar, could you see if commit 7efbe6d692 solves this?

If it's just the counter on the sidebar, could you see if commit https://git.meli.delivery/meli/meli/commit/7efbe6d6926b4c2d4b50170cbb1fb8e16cb5154d solves this?
oblitum commented 1 month ago
Poster

EDIT: I think you misunderstood my question, I meant that if you make changes from other clients, do they show up on meli?

Yes. I just closed and opened meli, then read some unread emails on my cellphone, and after a while it was updated on meli (counter/mail). I'm not confident with the test though because it was in ideal conditions just after a couple of minutes opening meli, my experience has shown in general that things are not that pretty after it has opened for an hour or so, will have to confirm.

If it's just the counter on the sidebar, could you see if commit 7efbe6d692 solves this?

I will check. Notice though that I also mention stuck unread emails, not just the counters (yep I'm only talking about menu counters so far, I completely missed status bar info).

> EDIT: I think you misunderstood my question, I meant that if you make changes from other clients, do they show up on meli? Yes. I just closed and opened meli, then read some unread emails on my cellphone, and after a while it was updated on meli (counter/mail). I'm not confident with the test though because it was in ideal conditions just after a couple of minutes opening meli, my experience has shown in general that things are not that pretty after it has opened for an hour or so, will have to confirm. > If it's just the counter on the sidebar, could you see if commit 7efbe6d692 solves this? I will check. Notice though that I also mention stuck unread emails, not just the counters (yep I'm only talking about menu counters so far, I completely missed status bar info).
oblitum commented 1 month ago
Poster

There's something funky happening now, maybe associated with synching to a cache read. I just built meli, then started it, and all folder counters were fine. Then, I switched to the folder where I've read two emails from my cellphone earlier. Guess what? When I switched to this folder the mail counter jumped by 2, and there was 7 unread emails, both in the counter as in the mail list, but I had read two of those already, and meli even got that, before I opened the folder.

There's something funky happening now, maybe associated with synching to a cache read. I just built meli, then started it, and all folder counters were fine. Then, I switched to the folder where I've read two emails from my cellphone earlier. Guess what? When I switched to this folder the mail counter jumped by 2, and there was 7 unread emails, both in the counter as in the mail list, but I had read two of those already, and meli even got that, before I opened the folder.
oblitum commented 1 month ago
Poster

And calling set seen on those is further increasing the counter by 1 after last commit.

And calling `set seen` on those is further **increasing** the counter by 1 after last commit.
oblitum commented 1 month ago
Poster

At the moment I'm not seeing the all mails counter jump happening anymore, but only that has gone away.

At the moment I'm not seeing the all mails counter jump happening anymore, but only that has gone away.
epilys commented 1 month ago
Poster
Owner

Alright, I will keep looking again and again at the code (not just the imap, but UI too). If you are not fatigued yet you could keep up with master and test if anything changes. Thanks a lot and I'm sorry I haven't figured this out any sooner.

Alright, I will keep looking again and again at the code (not just the imap, but UI too). If you are not fatigued yet you could keep up with master and test if anything changes. Thanks a lot and I'm sorry I haven't figured this out any sooner.
epilys added this to the IMAP support project 1 month ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loadingโ€ฆ
There is no content yet.