After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757166 - Clean up IMAP hierarchy delimiter handling
Clean up IMAP hierarchy delimiter handling
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: engine
master
Other Linux
: Normal normal
: 0.11.0
Assigned To: Geary Maintainers
Geary Maintainers
: 751756 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-10-27 04:45 UTC by Michael Gratton
Modified: 2016-08-08 14:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add hierarchy_delimiter to IMAP account, set it when claiming a session. (4.67 KB, patch)
2015-10-27 04:45 UTC, Michael Gratton
none Details | Review
Remove Geary.FolderRoot.default_separator (17.02 KB, patch)
2015-10-27 04:46 UTC, Michael Gratton
none Details | Review
Make MailboxSpecifier.from_folder_path delim parameter required (6.50 KB, patch)
2015-10-27 04:46 UTC, Michael Gratton
none Details | Review
Switch FolderPath and ImapDB.Folder's placeholder hierarchy delimiter (1.68 KB, patch)
2015-10-27 04:47 UTC, Michael Gratton
none Details | Review

Description Michael Gratton 2015-10-27 04:45:05 UTC
On IMAP servers that default to something other than a '/' as the IMAP hierarchy delimiter (such as Cyrus), Geary's use of '/' as a default that gets updated later causes a lot of bugs, especially in the presence of an unreliable network and working offline.

This can be reasonably easily solved (patches to follow) by simply removing the assumption. The main amount of work is in removing FolderRoot.default_separator, but most of the uses of FolderRoot use a null default_separator anyway. Then, by ensuring that an (X)LIST is done up front by ImapAccount so that it knows what the hierarchy delim should be, nearly all of the rest of the cases are taken care.

The only two places where we don't know the server's delimiter is in FolderPath.to_string() and in ImapDB.Folder.fetch_status_data(), but these cases don't matter since they never get passed to the server.

The final bit of work is in making MailboxSpecifier.from_folder_path require the delim param be non-null, which ensures nowhere else can make the original assumption.
Comment 1 Michael Gratton 2015-10-27 04:45:56 UTC
Created attachment 314178 [details] [review]
Add hierarchy_delimiter to IMAP account, set it when claiming a session.
Comment 2 Michael Gratton 2015-10-27 04:46:26 UTC
Created attachment 314179 [details] [review]
Remove Geary.FolderRoot.default_separator
Comment 3 Michael Gratton 2015-10-27 04:46:56 UTC
Created attachment 314180 [details] [review]
Make MailboxSpecifier.from_folder_path delim parameter required
Comment 4 Michael Gratton 2015-10-27 04:47:20 UTC
Created attachment 314181 [details] [review]
Switch FolderPath and ImapDB.Folder's placeholder hierarchy delimiter
Comment 5 Michael Gratton 2016-04-21 02:48:16 UTC
Adam: I've been running this series of patches against both a Cyrus and (I think) Dovecot for a while now with little issue, it's the last of the engine issues that made Geary difficult to use day-to-day on unreliable networks against Cyrus that I know of. Probably good to commit.
Comment 6 Adam Dingle 2016-04-21 14:07:47 UTC
OK - I've pushed all of these to master!  Closing this bug.
Comment 7 Michael Gratton 2016-08-08 14:44:58 UTC
*** Bug 751756 has been marked as a duplicate of this bug. ***