Bug 266666 - KMail cannot see a folder it created
Summary: KMail cannot see a folder it created
Status: REOPENED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: libakonadi (show other bugs)
Version: GIT (master)
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-19 14:04 UTC by Christopher Yeleighton
Modified: 2020-11-25 14:23 UTC (History)
6 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 Christopher Yeleighton 2011-02-19 14:04:01 UTC
Version:           1.13.6 (using KDE 4.6.0) 
OS:                Linux

KMail is able to create an IMAP folder to contain other folders but it cannot see it afterwards.

Reproducible: Always

Steps to Reproduce:
  1. Tell KMail to create a folder named "test" to contain other folders.
  2. Tell KMail to delete the folder "test".

Actual Results:  
  1. KMail creates the folder on the IMAP server but it does not display it.
  2. No way.

Expected Results:  
  1. 
KMail should show the folder so that the operator be able to delete it afterwards.

OS: Linux (x86_64) release 2.6.34.7-0.7-desktop
Compiler: gcc
Comment 1 S. Bryant 2013-09-30 07:34:37 UTC
This bug is still present in KDE 4.11.1.
Comment 2 S. Bryant 2013-09-30 13:23:45 UTC
Some more test results:

After creating new folders, these new ones are visible straight away in the serverside subscription list, but not in the local subscription list.  Changing various subscription settings makes no difference.

A second attempt to create a folder (correctly) fails because the folder already exists - but the folder still doesn't appear.

Folders created by other IMAP clients are treated the same way (ie: are not in the folder list).

Switching between normal and disconnected IMAP modes (and back) made no difference.  Explicitly updating the parent folder and all of its subfolders made no difference.

After restarting both Akonadi and Kontact, one of three new folders I created to test with appeared in the normal folder list.
Comment 3 Johannes Zarl-Zierl 2013-11-14 22:21:38 UTC
I am also affected by the issue.

The first time I was hit by this, I did the "workaround" of deleting the entire akonadi database, which worked for me.

I just noticed today (after trying to add a folder again), that the problem seems to be the insert statement in the akonadi database.

Akonadi prints the following message to the console:
> Error during executing query "INSERT INTO CollectionTable (remoteId, remoteRevision, name, parentId, resourceId, cachePolicyInherit, isVirtual) VALUES (:0, :1, :2, :3, :4, :5, :6)" :  "Duplicate entry '390-DevLoL' for key 'CollectionTable_parentAndNameIndex' QMYSQL3: Unable to execute statement"

When I connected manually to the akonadi mysql database, I noticed a naming problem:

mysql> select id, remoteId, name from collectiontable where resourceId = 26;
+------+----------------------------------------------+----------------------+
| id   | remoteId                                     | name                 |
+------+----------------------------------------------+----------------------+
|  407 | .INBOX                                       | INBOX                |
| 1441 | /DevLoL                                      | DevLoL               |
+------+----------------------------------------------+----------------------+
(most rows removed for privacy/brevity)

All the folders that work correctly have the remoteId field beginning with a dot, whereas the non-working folders begin with a slash.

Manually fixing the remoteId causes kmail to display the folder correctly.

I guess that kmail uses the incorrect value when creating the folder?
Comment 4 Daniel Vrátil 2013-11-15 09:13:15 UTC
Could you please re-test with KDE 4.11.3? There should be some bugfixes wrt IMAP separator.
Comment 5 S. Bryant 2013-11-15 11:06:41 UTC
After testing with 4.11.3, I am no longer able to reproduce the buggy behaviour.
It seems to be working fine!
Comment 6 Johannes Zarl-Zierl 2013-11-15 14:37:51 UTC
I just checked again after doing a dist-upgrade, and the problem persists.

Using kmail on Debian unstable:
$ kmail --version
Qt: 4.8.6
KDE Development Platform: 4.11.3
KMail: 4.11.3
Comment 7 Martin Koller 2013-11-15 18:27:17 UTC
I tested also with 4.11.3 and can confirm that a new folder (in root of imap) is created on the server by kmail but is not shown in kmail.
The akonadi db contains the new folder:

| id  | remoteId | remoteRevision | name  | parentId | resourceId | subscribed | cachePolicyInherit | cachePolicyCheckInterval | cachePolicyCacheTimeout | cachePolicySyncOnDemand | cachePolicyLocalParts | queryString | queryLanguage | isVirtual |
+-----+----------+----------------+-------+----------+------------+------------+--------------------+--------------------------+-------------------------+-------------------------+-----------------------+-------------+---------------+-----------+
| 438 | .test1   |                | test1 |      432 |         23 |          1 |                  1 |                       -1 |                      -1 |                       0 | NULL                  | NULL        | NULL          |         0 |
Comment 8 Martin Koller 2013-11-15 18:29:24 UTC
restarting only kmail shows the new folder.
Comment 9 Johannes Zarl-Zierl 2013-11-15 18:31:30 UTC
Martin is right: kmail 4.11.3 shows the folder after a restart.
Comment 10 Martin Koller 2013-11-15 18:42:27 UTC
Deleting this new "test1" folder deletes the folder in the akonadi db but immediately recreates it again (it will get a new id).
However, if the folder does contain a mail, the deletion works correctly.
Comment 11 S. Bryant 2013-11-27 12:47:31 UTC
(In reply to comment #5)
> After testing with 4.11.3, I am no longer able to reproduce the buggy
> behaviour.
> It seems to be working fine!

I must take that back.  After more usage, I'm still seeing this problem.

Steve
Comment 12 S. Bryant 2013-11-27 12:52:20 UTC
Also - restarting kmail (or even rebooting) does not show me some folders.  I get this when a folder is created by kmail on another machine.
Comment 13 Christian Mollekopf 2014-01-20 12:38:01 UTC
This is a bug in the ETM for which I have a patch in progress.
Comment 14 Christian Mollekopf 2014-01-20 12:45:01 UTC
Also note that this bug is about successfully creating a folder that is afterwards not visible in kmail until restarted. The otherissue with the separator is separately handled in Bug 323844.
Comment 15 Christian Mollekopf 2014-01-20 13:50:07 UTC
Git commit 9eac241c9dde13af7ae8a2875efc96cb0da23fc7 by Christian Mollekopf.
Committed on 20/01/2014 at 12:49.
Pushed by cmollekopf into branch 'master'.

React to collection changes that cause a collection to match a filter.

Some obvious cases were:
* if you create a collection in kmail it is not displayed until kmail is
restarted (the mimetype arrives via a dataChanged signal)
* kolab folders were visible in kmail until restarted

Those cases are now properly handled by adding/removing the collection as
appropriate.
REVIEW: 115145

M  +24   -13   akonadi/entitytreemodel_p.cpp
M  +9    -0    akonadi/entitytreemodel_p.h

http://commits.kde.org/kdepimlibs/9eac241c9dde13af7ae8a2875efc96cb0da23fc7
Comment 16 S. Bryant 2014-02-13 13:14:12 UTC
Hi,

Did this fix make it into 4.12.2? I'm still seeing this problem.

Steve
Comment 17 Daniel Vrátil 2014-02-17 14:38:00 UTC
No, the fix will be available in 4.13.
Comment 18 Wolfgang Bauer 2014-04-27 20:10:33 UTC
I can confirm that this works as expected in 4.13 for me.
A newly created folder is visible immediately now.

Thank you!
Comment 19 Christopher Yeleighton 2020-11-25 14:23:29 UTC
It is now impossible to create such a container from within KMail but:
 1. The container I created back in 2011 still exists.
 2. KMail does not let me subscribe to it.
 3. Accordingly, there is no way to delete it.
 4. However, it is not possible to create a folder of the same name.

All in all, my user experience is crippled.