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 712902 - Don't show childless [Gmail] in Folders list
Don't show childless [Gmail] in Folders list
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: engine
master
Other All
: High normal
: 0.13.0
Assigned To: Geary Maintainers
Geary Maintainers
: 725232 735098 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-06-22 10:09 UTC by Jim Nelson
Modified: 2019-01-15 03:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch proposal v1 -- wip (5.14 KB, patch)
2017-02-23 09:22 UTC, Gautier Pelloux-Prayer
none Details | Review
patch proposal v2 (1.95 KB, patch)
2017-03-02 11:37 UTC, Gautier Pelloux-Prayer
none Details | Review

Description Charles Lindsay 2013-11-21 20:17:37 UTC


---- Reported by jim@yorba.org 2012-06-22 15:09:00 -0700 ----

Original Redmine bug id: 5444
Original URL: http://redmine.yorba.org/issues/5444
Searchable id: yorba-bug-5444
Original author: Jim Nelson
Original description:

The magic [Gmail] (or, for some accounts, [GoogleMail]) and its child
Important are now shown in the Labels list due to #3704.

We should not show [Gmail] unless it has children not treated as special
folders. Important should be displayed when we implement #5094.

Related issues:
related to geary - Feature #5094: Display "Important" Gmail folder (Fixed)
related to geary - Feature #6510: Support sub-foler (Need Information)
duplicated by geary - 6814: Don't show [Gmail] label (Duplicate)



---- Additional Comments From geary-maint@gnome.bugs 2013-05-15 14:34:00 -0700 ----

### History

####

#1

Updated by Adam Dingle about 1 year ago

  * **Assignee** deleted (<strike>_Jim Nelson_</strike>)

####

#2

Updated by Adam Dingle about 1 year ago

  * **Target version** deleted (<strike>_0.2_</strike>)

####

#3

Updated by Jim Nelson 10 months ago

  * **Subject** changed from _[Gmail] and [Gmail]/Important shown_ to _[Gmail] shown in Folders list_
  * **Target version** set to _0.3.0_

Important has been handled. All that's left is removing the [Gmail] folder.

####

#4

Updated by Jim Nelson 9 months ago

  * **Target version** changed from _0.3.0_ to _0.4.0_

####

#5

Updated by Jim Nelson 6 months ago

  * **Subject** changed from _[Gmail] shown in Folders list_ to _Don't show childless [Gmail] in Folders list_
  * **Description** updated (diff)
  * **Target version** changed from _0.4.0_ to _0.5.0_

Updated to reflect that there are some situations where Geary needs to display
[Gmail], since some other clients out there are adding their own folders under
it. However, since [Gmail] by itself is not interesting, it should be hidden
if it has no children.

The broader rule for Geary should be: if a Folder has no children and is not
SELECTable (i.e. "!openable" in FolderProperties parlance), then it should not
be displayed.



--- Bug imported by chaz@yorba.org 2013-11-21 20:17 UTC  ---

This bug was previously known as _bug_ 5444 at http://redmine.yorba.org/show_bug.cgi?id=5444

Unknown milestone "unknown in product geary. 
   Setting to default milestone for this product, "---".
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.
Resolution set on an open status.
   Dropping resolution 

Comment 1 Charles Lindsay 2014-02-26 19:12:23 UTC
*** Bug 725232 has been marked as a duplicate of this bug. ***
Comment 2 Jim Nelson 2014-08-21 19:01:27 UTC
*** Bug 735098 has been marked as a duplicate of this bug. ***
Comment 3 Gautier Pelloux-Prayer 2017-02-20 20:09:09 UTC
Hello Mike,

This bug is rather old but still here in master, so I'd like to tackle it down: what approach should I have here?

Currently if you try to open this folder in left pane you will get:

> d 21:03:32 imap-engine-minimal-folder:722: Soft failure opening or preparing remote folder Gmail:account_02:[Gmail] (open_count=1 remote_opened=true), closing: Server disallowed SELECT [Gmail]: a005 NO [NONEXISTENT] Unknown Mailbox: [Gmail] (Failure)

Possible solutions are:

1) hide it in the left pane in any-case
2) make it unselectable (as "Labels") in left pane in any-case?
3) make it unselectable if it has children, and hide it otherwise
4) make something deeper in the engine itself, eg. "removing" the folder from the account folders list?
Comment 4 Michael Gratton 2017-02-23 05:43:02 UTC
I tend to agree with Jim:

> The broader rule for Geary should be: if a Folder has no children and is not
> SELECTable (i.e. "!openable" in FolderProperties parlance), then it should not
> be displayed.

It might be worth running with --log-network and seeing what GMail is actually reporting for that folder when Geary does a LIST/XLIST at startup. If we do know that it isn't openable in advance (or even if it requires the SELECT to fail as you note above) and can work out it won't have any children, then yeah, just hide it. If a user-made sub-folder is then later added, it should obviously then show up again.
Comment 5 Gautier Pelloux-Prayer 2017-02-23 09:22:30 UTC
Created attachment 346540 [details] [review]
patch proposal v1 -- wip

The fact is: [Gmail] folder is the parent of all Gmail folders (at least drafts, trash, important, all mails, spam, starred). 

But I guess I'm doing something similar to your approach, see the current **wip** patch (which currently aborts).
Comment 6 Michael Gratton 2017-02-23 22:42:16 UTC
Hmm, I wonder if rather than adding [Gmail] to the branch and then trying to hide it it later, would be to not add it in the first place (since it's folder properties should say it isn't openable)? Then also check whenever adding a normal (i.e. not special) folder that all of its ancestors have been added - and if not then add its ancestors then.
Comment 7 Gautier Pelloux-Prayer 2017-02-26 22:38:25 UTC
Oops, my bad - this patch was actually meant for Bug 754802 (hide "Labels" folder if none present).
For [Gmail] folder indeed I'll follow your approach.
Comment 8 Michael Gratton 2017-02-27 14:30:53 UTC
No problem, would the same approach work there as well, however?
Comment 9 Gautier Pelloux-Prayer 2017-03-02 11:37:31 UTC
Created attachment 347050 [details] [review]
patch proposal v2

Well, I think it's easier to not add them on the upper layer like the following approach. 
WDYT?
Comment 10 Michael Gratton 2018-06-26 04:47:48 UTC
Bump tickets to 0.14 that aren't going to make 0.13.
Comment 11 Bjørn Lie 2019-01-12 00:00:05 UTC
Just tested this patch, worked perfectly :-) - even applied cleanly.
Comment 12 Michael Gratton 2019-01-15 03:18:57 UTC
Thank for the bump. :)

I took a look at the patch (it does need some rebasing after recent changes to master). There's probably an unhandled corner case when a new folder gets added below one that has already been hidden, and that isn't handled specially as in the case of the [Gmail] folder, but hopefully that's reasonably rare.

So I will landed this as-is on master and will see if anyone complains.

https://gitlab.gnome.org/GNOME/geary/merge_requests/84