[imp] Dimp : Folders tree partially updated after a rename folder action

Emeric Jhelil Emeric.Jhelil at univ-lemans.fr
Fri Nov 28 16:35:30 UTC 2008


Dimp : Folders tree partially updated after a rename folder action

Installation infos : horde-webmail-1.2 ; php-5.2.6 ; debian etch

By Dimp interface, after the renaming of a new folder, the folders tree 
is partially updated dynamically.

For instance, I try to rename the folder "foo" in "bar".

1) If I have no other virtual folder but the virtual inbox, then :
- I get the message 'The folder "foo" was successfully renamed to "bar"'.
But :
- The folder "foo" doesn't disappear from the folders tree.
- The folder "bar" doesn't appear in the folders tree.

Setting the javascript debugging and using dimp/js/src produces an alert :
with Firefox 2.0.0.18 :
 doActionComplete callback: TypeError-$(elt) has no properties
with IE7
  doActionComplete callback: TypeError-'null' is null or not an object

Refreshing the page produces a single change :
- The folder "bar" appears successfully in the folders tree.
I need to disconnect-reconnect to see the correct folders tree without 
the folder "foo".

2) If I have created (and saved) a virtual folder by Imp interface, then :
- I get the message 'The folder "foo" was successfully renamed to "bar"'.
- The folder "bar" appears successfully in the folders tree.
But :
- The folder "foo" doesn't disappear from the folders tree.

Setting the javascript debugging and using dimp/js/src produces no alert.

Refreshing the page produces no change.
I need to disconnect-reconnect to see the correct folders tree without 
the folder "foo".

The difference between the 2 situations is probably linked to the 
virtual folders as I wrote in my precedent message "Dimp : folders tree 
not updated after an add (new) folder action" (first tome of "my dimp 
chronicles").
If I use my modification to avoid the virtual folders being in the 
getFolderResponse result (horde/dimp/lib/DIMP.php), the situation 1 is 
identical to the situation 2.

Concerning the remaining "foo" folder, it might be due to the use of the 
function _getList before the deletion of the folder "foo". It sets the 
static variable $full_list with the folder "foo" and caches it even 
after its correct deletion. So, this folder is finally maintained and 
does not make part of the deleted folders in the getFolderResponse result.

If I am not mistaken, a part of the calls is :
with Folder as horde/imp/lib/Folder.php, Search as 
horde/imp/lib/Search.php, Tree as horde/imp/lib/IMAP/Tree.php
- Previous calls to folderList set $full_list with the folder "foo"
Folder.rename calls
  Folder._onDelete which calls
    Search.sessionSetup(true) which calls
      Search.createVINBOXFolder which calls
        Tree.getPollList which calls
          Tree.folderList which calls
            Tree.showUnsubscribed which calls
              Tree._getList which returns by the 1st return instruction 
with $full_list already set

I tried to put aside the use of $full_list to make the Tree._getList 
function returns by the 3rd return instruction.
It makes the folder "foo" disappear properly in situation 1 and 2, but 
still needs a refreshing of the page to make the folder "bar" appear in 
situation 1.

In horde/imp/lib/IMAP/Tree.php (v 1.25.2.60) :
--- horde/imp/lib/IMAP/Tree.php 2008-11-27 10:35:23.000000000 +0100
+++ horde-webmail-1.2_um/imp/lib/IMAP/Tree.php  2008-11-27 
11:42:07.000000000 +0100
@@ -313,8 +313,13 @@
 
         // Cached mailbox lists.
         if ($showunsub) {
+/* Debut UM EJ : 20-11-2008 */
+/*
             $full_list = array_keys($names);
             return $full_list;
+*/
+            return array_keys($names);
+/* Fin UM EJ : 20-11-2008 */
         } else {
             // Need to compare to full list to remove non-existent 
mailboxes
             // See RFC 3501 [6.3.9]


If I add the modification of my precedent message "Dimp : folders tree 
not updated after an add (new) folder action", renaming a folder reacts 
dynamically and successfully in situation 1,
- I get the message 'The folder "foo" was successfully renamed to "bar"'.
- The folder "foo" smoothly disappears from the folders tree.
- The folder "bar" appears in the folders tree.

Maybe I have been a bit long this time (second tome of "my dimp 
chronicles" finished) !

Thanks for reading and help.

Emeric



More information about the imp mailing list