Bug 308952 - Messages disappear after folder rename
Summary: Messages disappear after folder rename
Status: RESOLVED WORKSFORME
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: GIT (master)
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-24 19:32 UTC by Kjetil Kilhavn
Modified: 2016-09-27 06:17 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kjetil Kilhavn 2012-10-24 19:32:53 UTC
This bug seems related to 308378 - https://bugs.kde.org/show_bug.cgi?id=308378 - but I do not get any messages about the folder not existing. Therefore I decided to post it as a new report.
I was also unsure whether it should be reported as a Akonadi or KMail2 problem, feel free to reassign :-)

In a (local) folder I had three messages.
I renamed the folder (from Vivaldi to Plasma Active, not that it should matter) and moved three more messages to the folder.
In the message list, all messages were displayed, but only the new messages would be displayed when selected.

I suspected the problem was related to the renaming of the folder.
Now, in slight desperation, I tried several tricks, so my memory is perhaps not complete. As a software developer I should be sensible enough to write down the steps once I suspected it was a bug - but unfortunately I was not.

Now, as I am writing this, I have two folders. One named Plasma Active and one named Vivaldi. I believe the Vivaldi is the original folder re-named again in the hope that the messages would magically reappear, and the Plasma Active is a new folder I created (sibling of Vivaldi). However, memory may serve me wrong, and I may also have renamed the folder more than twice.

Anyway, the end result was that none of the folders displayed any messages!
However, in disk folder "~/.local/share/.local-mail.directory/.KDE.directory/Vivaldi/new" the original three messages are present - so the mail has not been lost.

The three new messages I had moved to the folder after renaming it mysteriously disappeared, but were found again in the inbox and sent mail folders - who said computers are not intelligent!

I tried to move one of those messages to the Plasma Active folder. The message now appears in both the Plasma Active folder and the Vivaldi folder in KMail, but on disk it is found in the "~/.local/share/.local-mail.directory/.KDE.directory/Plasma Active/new" folder.

I closed KMail (Kontact) and re-opened it. That did not solve or create any problems, i.e. the Plasma Active and Vivaldi folders still show the message I moved to the Plasma Active folder - and the folders on disk still have the correct messages as described above.

Reproducible: Always

Steps to Reproduce:
1. Create a local folder and move a message into it.
2. Rename the folder and move another message into it.
3. Click on the message you first moved into the folder to display it.
Actual Results:  
Message is not displayed in message view area.

Expected Results:  
Message is displayed in message view area.

Although the data are not actually lost they appear to be lost, and only people who know where to look will find the messages. If KMail had been able to restore correct display after a restart the problem would not be as severe as it now (in my opinion) is.
Comment 1 Laurent Montel 2012-10-25 07:21:18 UTC
"from Vivaldi to Plasma Active" what is Vilvaldi ?
Comment 2 Kjetil Kilhavn 2012-10-25 09:25:01 UTC
(In reply to comment #1)
> "from Vivaldi to Plasma Active" what is Vilvaldi ?
It's just a name. I can't believe it matters much to KMail whether the local folder name is “Vivaldi” or “Tablet”.
Comment 3 Kjetil Kilhavn 2012-10-25 22:03:24 UTC
After a reboot the "Vivaldi" folder displays the three messages it originally held, and the "Plasma Active" folder displays the single message I moved to that folder.

Importance reduced from "critical" to "normal".
Comment 4 Christian Saemann 2012-11-05 11:44:28 UTC
I have the same problem (Kmail 4.9.2). If a folder is renamed, the emails in that folder are listed in kmail but their body is not displayed once one clicks on them. It must be some synchronization issue between the folders on the harddrive and some internal representation. If I close kontact, move the folder physically on the drive to a new name via "mv", and reopen kontact, then kmail displays the messages in the new folder correctly.
Comment 5 Unknown 2013-01-23 10:21:40 UTC
Yes. The problem seams to be: One needs to "logout" and "loging" again after a "Rename" action.
Comment 6 Sunito 2013-01-24 11:09:59 UTC
I also had this Problem with KDE 4.9.4 on Netrunner (Ubuntu).
The problem even appeared, when I was moving folders to another parent folder.
I don't know if this would be a separate bug, so I'll try to give details below:

Whenever I move a folder to a new parent folder, it and its content will be moved
to the new location, both in the KMail interface and on the file system. 
If I then immediately afterwards move a message into this moved folder (in its new location) , 
it will apear to have moved in the KMail interface but it will not change its place in the maildir.
It will reappear after a while in its old location in KMail, at both places in KMail its content will 
be displayed correctly. A mere KMail restart will not change this, only after I restart Akonadi,
the message will disappear at the new location in KMail and only be displayed at its original
location. (Thus reflecting the situation on the file system.)

This is reproducible, I did this a few times.
I did it on "Locale Ordner" (~/.local/share/local-mail), everything was maildir (no mbox).
Comment 7 Denis Kurz 2016-09-24 20:44:05 UTC
This bug has only been reported for versions older than KDEPIM 4.14 (at most akonadi-1.3). Can anyone tell if this bug still present?

If noone confirms this bug for a recent version of akonadi (part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 8 Kjetil Kilhavn 2016-09-26 23:57:42 UTC
The problem appears to have been fixed, but I can only speak for my own configuration which is KMail 5.1.3 / Frameworks 5.21 / Plasma 5.5.5 / Qt 5.5.1 in openSUSE Leap 42.1,
Comment 9 Denis Kurz 2016-09-27 06:17:52 UTC
Thanks Kjetil for your reply, closing.