Bug 341114

Summary: Focus Jumps To Another Message Spontaneously When Server Refresh
Product: [Applications] kmail2 Reporter: Garry Williams <gtwilliams>
Component: message listAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal CC: antenore, dsp112358, kdenis
Priority: NOR    
Version: 5.4.3   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Garry Williams 2014-11-20 05:31:23 UTC
Occasionally focus is changed to another (seemingly random) message spontaneously.  It seems to happen when the IMAP (Gmail) server is refreshing.  I believe that focus always lands on an already-read message.

This is very irritating since I now need to find the message I was reading before to resume.

This bug is fairly old, probably since KDE 4 originally shipped in Fedora.

Reproducible: Sometimes

Steps to Reproduce:
1. Read mail
2. Wait for refresh
3. Repeat

It doesn't always happen on a refresh.  I have no idea what the triggering conditions are.  :-(

Actual Results:  
Message list focus jumps to another message.

Expected Results:  
Leave focus on the message I'm reading until I change it.

Maybe automatic expiration (moving message to local folder) is also triggering event, but not sure.  I have many folders in Gmail set to expire message older than a few months by moving them to a local folder.  For example, my foo folder messages migrate over time to my foo-old local folder.
Comment 1 dSP 2014-11-30 22:10:06 UTC
I opened bug 341292 recently and didn't see this one. 
It sounds connected.
Comment 2 Garry Williams 2016-11-11 19:38:40 UTC
This irritating bug persist to this day with kmail2 5.3.0 (Fedora rpm kmail-16.08.2-1.fc24.x86_64).
Comment 3 Garry Williams 2017-06-24 03:16:10 UTC
Still happens usually after a mail check is done on the interval I specified.  Very irritating to be reading a message and have another message jumped to out of the blue.

    kmail-16.12.3-1.fc25.x86_64
    kmail-libs-16.12.3-1.fc25.x86_64
    $ kmail --version
    kmail2 5.4.3
    $
Comment 4 Antenore Gatta 2020-01-24 16:27:46 UTC
I'm experiencing this problem also on Arch Linux (kmail 19.12.1), on the contrary, on Fedora 30, with 19.04.2 it works perfectly.

I don't think the version is important in this case. There's something that goes wrong while using kmail (after some time using it, I mean).

I've as well Gmail, but also other mail account providers.

├Źn the next days I'll try to clean up the profile folders, in the mean while, can you guys let me know if and how I can debug this? 

One thing I've found is that I can reproduce this bug (only on Arch at the moment) switching between kmail and other windows or even changing workspace.

The highlighted email is always one older than a specific date/time, if I move or delete that email, the focused/highlighted email is the next one.

So there's probably something wrong in the email index (?????). Or some corruption happened starting from a specific date.

I don't know if I'm saying bs regarding the index :-P ... It's just guessing.

Let me know how can I debug this and I'll share more details with pleasure.

Thanks!!!