Bug 440563 - Moving two emails to another folder overwrites one with the other in local cache
Summary: Moving two emails to another folder overwrites one with the other in local cache
Status: REPORTED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: IMAP resource (show other bugs)
Version: 6.3.0
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-03 18:16 UTC by Brendon Higgins
Modified: 2025-02-04 18:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brendon Higgins 2021-08-03 18:16:30 UTC
Hi,

I have a GMail account with Inbox and another folder. I have three related messages, one (#1) in Inbox and two (#2 and #3) in the folder. After selecting the two messages in the folder, I dragged them them into Inbox (move). The three messages were threaded together in Inbox, but somehow #3 was replaced by a duplicate of #2! Now in KMail it looks like I have two identical messages in this thread following #1.

This seems to be a local cache bug. The GMail interface shows the original email #3, now in Inbox. Poking around in Akonadi Console (while pretending I know what I'm doing in here) I see Remote ID's differ by 1, and so do Unique ID's. The "later" one, which I guess is #3, seems to have Revision 2, whereas the other (presumably #2) has Revision 1. Not sure what that implies.

Let me know if I can provide more info, though at some point I will need to invalidate this local cache to fix the problem.

Best,
Brendon
Comment 1 Brendon Higgins 2023-01-03 21:37:26 UTC
Still happens, so updating this bug's meta-data. (I had actually forgotten I'd already reported this, and only realized after going through the process of searching for similar bugs, finding this report, and seeing the original reporter's name was strikingly familiar...)
Comment 2 Brendon Higgins 2023-10-23 02:39:38 UTC
I have now seen this happen when selecting two unrelated emails at once and moving them into another folder: the pair turns into duplicates of one of the emails. If I clear the Akonadi cache for that folder, when the messages are re-downloaded, they appear correct.
Comment 3 Brendon Higgins 2025-02-04 18:18:56 UTC
Just tested, this bug still occurs on Debian's latest builds in testing: I select two emails in KMail, move them to another folder, it syncs, and now the two cached emails both have identical bodies. Don't even need to restart Akonadi or anything. If I do restart Akonadi, then the subject and dates in KMail also become identical (though the attachment icon seems to stay intact). If I clear the cache of that folder and resync, they're back to normal.

I'm tempted to change the affected version of the bug to GIT master - think it'd be a safe bet at this point.

FWIW I have serveral IMAP accounts, all GMail, and seems to happen on any of them.

Perhaps a race condition, or maybe the cache DB write routine simply fails to iterate through the emails when getting contents. I wonder if there's a scenario for true data loss, like if I moved the duplicate email a second time to another folder...