Re: [Bug+Fix] broken mailbox view after moving IMAP folder sideways



Hi Albrecht:

On 03/09/2019 10:05:37 AM Sat, Albrecht Dreß wrote:
Hi all,

I noticed a bug when a folder on a IMAP server is moved sideways, e.g. from “INBOX/Folder1/Test” to 
“INBOX/Folder2/Test”: after moving, a partial re-scan of the mailbox tree is performed, which makes all my 
local folders disappear.  The effect does not occur if the folder is moved up or down the tree.  I could 
track down the source of the issue to src/folder-conf.c, function subfolder_conf_clicked_ok().

At least for me, the attached patch fixes the problem:  simply re-scan the whole IMAP server folder tree.  As 
moving folders around on an IMAP server is typically not a frequent operation, the performance penalty (if 
there is any) should be negligible.

Thanks for the patch! Committed and pushed to GitLab.

We /might/ even consider to simplify the whole block starting at src/folder-conf.c, line 566, to just 
re-scanning the whole server, but as I mentioned above, the other two use cases work fine for me.

That would simplify the code (which is sorely needed in that file!). It would add more round trips, but 
that's surely less of an issue than it was when that code was written (in the earliest years of this 
century!).

If RTTs are still an issue, we would need a more careful fix. From the look of the code, it appears that the 
intent was to find the nearest common ancestor of the old path to the folder and the new one, and re-scan 
just from that node. If the heuristic for finding it ever worked, it clearly no longer does, but a more 
careful search could probably be constructed.

Thanks again for all your work!

Peter

Attachment: pgpokQmwPm3qm.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]