Mail: Favorites folder sometimes appear as sub-folder of inbox even if it's not

Created on 14 Sep 2017  ·  33Comments  ·  Source: nextcloud/mail

With master
https://github.com/nextcloud/mail/blob/632e9ed934b269ec0bf8742a92c9afe0ff4ec3ae/lib/Service/FolderMapper.php#L70-L92

Gives me:

array(
    0 => stdClass::__set_state(array(
        'id' => 'SU5CT1g=',
        'accountId' => 4,
        'name' => 'Inbox',
        'specialRole' => 'inbox',
        'unseen' => 0,
        'total' => 2,
        'isEmpty' => false,
        'noSelect' => false,
        'attributes' => array(
            0 => '\marked',
            1 => '\hasnochildren',
        ) ,
        'delimiter' => '/',
        'folders' => array() ,
        'syncToken' => 'xxxxxx',
    )) ,
    1 => stdClass::__set_state(array(
        'id' => 'SU5CT1gvRkxBR0dFRA==',
        'accountId' => 4,
        'name' => 'Favorites',
        'specialRole' => 'flagged',
        'unseen' => 0,
        'total' => 0,
        'isEmpty' => true,
        'noSelect' => false,
        'attributes' => array(
            0 => '\marked',
            1 => '\hasnochildren',
            2 => '\Flagged',
        ) ,
        'delimiter' => '/',
        'folders' => array() ,
        'syncToken' => NULL,
    )) ,
    2 => stdClass::__set_state(array(
        'id' => 'RHJhZnRz',
        'accountId' => 4,
        'name' => 'Drafts',
        'specialRole' => 'drafts',
        'unseen' => 0,
        'total' => 1,
        'isEmpty' => false,
        'noSelect' => false,
        'attributes' => array(
            0 => '\hasnochildren',
            1 => '\drafts',
        ) ,
        'delimiter' => '/',
        'folders' => array() ,
        'syncToken' => 'xxxxxx=',
    )) ,
    3 => [REMOVED FOR READABILITY]
);

It's probably related to the id of the two folders:

  • SU5CT1g=
  • SU5CT1gvRkxBR0dFRA==

Which gives us respectively:

  • INBOX
  • INBOX/FLAGGED

So the favorite folder appear as subs even if it has the hasnochildren attribute.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

1. to develop bug

Most helpful comment

Ah right. Got it. The problem is only visible if the accounts delimiter is /. If it's . you don't see it as subfolder 😉

All 33 comments

Yup, can confirm! It also looks strange in the interface.

Normal:
screenshot from 2017-09-14 15-33-37
When »expanding« the inbox:
screenshot from 2017-09-14 15-33-53

So essentially it stays the same. ;) Getting this with my gandi.net account

Ah right. Got it. The problem is only visible if the accounts delimiter is /. If it's . you don't see it as subfolder 😉

@ChristophWurst ChristophWurst moved from IN PROGRESS (max 3) to SELECTED in Christoph's Tasks 2 days ago

Noooooooo :D

ChristophWurst moved from IN PROGRESS (max 3) to TO REVIEW (max 4) in Christoph's Tasks just now

@skjnldsv better now? 😉

You're amazing!! ☺️😉

@ChristophWurst I still get subs on folders that should not! :(
capture d ecran_2017-09-20_07-41-16

The Tests folders, the "All inboxes" too :)

@skjnldsv I thought you reviewed/tested my PR 😛

Could you please post the JSON response that contains the folder structure?

@ChristophWurst I did, but I only had one account and not created subfolders that long before! :)

@ChristophWurst

{
    "INBOX":{
        "id":"SU5CT1g=",
        "accountId":1,
        "name":"Inbox",
        "specialRole":"inbox",
        "unseen":0,
        "total":2,
        "isEmpty":false,
        "noSelect":false,
        "attributes":[
            "\\marked",
            "\\hasnochildren"
        ],
        "delimiter":"\/",
        "folders":[

        ],
        "syncToken":"VTE3MzQsVjE0LE0y"
    },
    "INBOX\/FLAGGED":{
        "id":"SU5CT1gvRkxBR0dFRA==",
        "accountId":1,
        "name":"Favorites",
        "specialRole":"flagged",
        "unseen":0,
        "total":0,
        "isEmpty":true,
        "noSelect":false,
        "attributes":[
            "\\marked",
            "\\hasnochildren",
            "\\Flagged"
        ],
        "delimiter":"\/",
        "folders":[

        ],
        "syncToken":null
    },
    "Drafts":{
        "id":"RHJhZnRz",
        "accountId":1,
        "name":"Drafts",
        "specialRole":"drafts",
        "unseen":0,
        "total":1,
        "isEmpty":false,
        "noSelect":false,
        "attributes":[
            "\\hasnochildren",
            "\\drafts"
        ],
        "delimiter":"\/",
        "folders":[

        ],
        "syncToken":"VTEwMixWOTAsTTE="
    },
    "Sent":{
        "id":"U2VudA==",
        "accountId":1,
        "name":"Sent",
        "specialRole":"sent",
        "unseen":0,
        "total":1,
        "isEmpty":false,
        "noSelect":false,
        "attributes":[
            "\\hasnochildren",
            "\\sent"
        ],
        "delimiter":"\/",
        "folders":[

        ],
        "syncToken":"VTIsVjExLE0x"
    },
    "Archive":{
        "id":"QXJjaGl2ZQ==",
        "accountId":1,
        "name":"Archive",
        "specialRole":"archive",
        "unseen":0,
        "total":0,
        "isEmpty":true,
        "noSelect":false,
        "attributes":[
            "\\hasnochildren"
        ],
        "delimiter":"\/",
        "folders":[

        ],
        "syncToken":"VTEsVjc1"
    },
    "Junk":{
        "id":"SnVuaw==",
        "accountId":1,
        "name":"Junk",
        "specialRole":"junk",
        "unseen":0,
        "total":0,
        "isEmpty":true,
        "noSelect":false,
        "attributes":[
            "\\hasnochildren",
            "\\junk"
        ],
        "delimiter":"\/",
        "folders":[

        ],
        "syncToken":"VTEsVjk0"
    },
    "Deleted":{
        "id":"RGVsZXRlZA==",
        "accountId":1,
        "name":"Trash",
        "specialRole":"trash",
        "unseen":0,
        "total":0,
        "isEmpty":true,
        "noSelect":false,
        "attributes":[
            "\\haschildren",
            "\\trash"
        ],
        "delimiter":"\/",
        "folders":[

        ],
        "syncToken":"VTE1MCxWMTI="
    },
    "Notes":{
        "id":"Tm90ZXM=",
        "accountId":1,
        "name":"Notes",
        "specialRole":null,
        "unseen":0,
        "total":0,
        "isEmpty":true,
        "noSelect":false,
        "attributes":[
            "\\hasnochildren"
        ],
        "delimiter":"\/",
        "folders":[

        ],
        "syncToken":"VTEsVjk2"
    },
    "Outbox":{
        "id":"T3V0Ym94",
        "accountId":1,
        "name":"Outbox",
        "specialRole":null,
        "unseen":0,
        "total":0,
        "isEmpty":true,
        "noSelect":false,
        "attributes":[
            "\\hasnochildren"
        ],
        "delimiter":"\/",
        "folders":[

        ],
        "syncToken":"VTEsVjEz"
    },
    "Test":{
        "id":"VGVzdA==",
        "accountId":1,
        "name":"Test",
        "specialRole":null,
        "unseen":0,
        "total":0,
        "isEmpty":true,
        "noSelect":false,
        "attributes":[
            "\\haschildren"
        ],
        "delimiter":"\/",
        "folders":[
            {
                "id":"VGVzdC9TdWJUZXN0",
                "accountId":1,
                "name":"Test\/SubTest",
                "specialRole":null,
                "unseen":0,
                "total":0,
                "isEmpty":true,
                "noSelect":false,
                "attributes":[
                    "\\haschildren"
                ],
                "delimiter":"\/",
                "folders":[

                ],
                "syncToken":"VTEsVjEzOA=="
            },
            {
                "id":"VGVzdC9TdWJUZXN0L1N1YlRlc3Q=",
                "accountId":1,
                "name":"Test\/SubTest\/SubTest",
                "specialRole":null,
                "unseen":0,
                "total":0,
                "isEmpty":true,
                "noSelect":false,
                "attributes":[
                    "\\hasnochildren"
                ],
                "delimiter":"\/",
                "folders":[

                ],
                "syncToken":"VTEsVjEzOQ=="
            }
        ],
        "syncToken":"VTEsVjEzNg=="
    }
}

And for the unified mailbox:

{
    "accountId":-1,
    "email":"",
    "folders":[
        {
            "id":"YWxsLWluYm94ZXM=",
            "parent":null,
            "name":"All inboxes",
            "specialRole":"inbox",
            "unseen":0,
            "total":100,
            "isEmpty":false,
            "accountId":-1,
            "noSelect":false,
            "uidvalidity":{
                "1":14,
                "2":14
            },
            "uidnext":{
                "1":1734,
                "2":39
            },
            "delimiter":"."
        }
    ],
    "specialFolders":[

    ],
    "delimiter":"."
}

Hm, I don't see any issues with the response from above. What's wrong there?

The unified inbox should not appear as a subfolder. :)
And we don't allow more than one subfolder, we should display subs as folder/subfolder. :)

The unified inbox should not appear as a subfolder. :)

It's a top folder of account -1 according to that reponse

And we don't allow more than one subfolder, we should display subs as folder/subfolder. :)

That is exactly what we do IIRC

That is exactly what we do IIRC

Like Test/SubTest/SubTest reults in a folder SubTest/SubTest inside Test

It's a top folder of account -1 according to that

Well it's displayed as a subfolder of an empty account. :/

That is exactly what we do IIRC

It is displayed as a continuity of ul > li, so it's not displayed as a first level entry! :)

Like Test/SubTest/SubTest reults in a folder SubTest/SubTest inside Test

Well, since all the he main folders are already sub entries, SubTest/Subtext should not exist! :p

Okay, so what branch are you using actually? Master?

Yes I am! :)
Do you think we should allow two sub folders?

bildschirmfoto von 2017-09-20 20-54-37

Hm, for me master looks totally fine 😮

Checked with @jancborchardt and it's fine on his instance too

Did you looked the code?

Master outputs this:

<div class="navigation-account">
    <h2 class="mail-account-email" title=""></h2>
    <div class="folders with-icon">
        <ul>
            <li class="active special-inbox">
                <a class="folder icon-inbox svg" href="/apps/mail/xxx">All inboxes</a>
                <div class="folders">
                    <ul></ul>
                </div>
            </li>
        </ul>
    </div>
</div>

This should be this (or with h2 on master):

<div class="navigation-account">
    <h2 class="mail-account-email" title="All inboxes">All inboxes</h2>
</div>

For the subfolders, I'll try to find an alternative! :)
Don't worry about it! Thanks for your time @ChristophWurst !

@skjnldsv also note that on your screenshot the folders of the account are indented one step from the account name. Whereas in @ChristophWurst’s screenshot it is as intended – account name and first level folders on the first level. :)

@jancborchardt it's a css fix on the mail app. They override the default indentation! :)

@jancborchardt it's a css fix on the mail app. They override the default indentation! :)

Okay, so basically #516. I'm closing this ticket thus.

Damn it. No it's not related to the CSS fix. The all inbox item should NOT appear as a subfolder. It's a main entry.
I'm speaking about the code, not the design.

Sorry, I just feel so misunderstood! :(

In the end, is this fixed @ChristophWurst?

For me it is. can you confirm? :)

Usually I would close this but I've already once closed it although you still had the issue, so I'm a bit hesitant this time 😉

It looks good on my side. :)

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and questions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cheesewizz picture cheesewizz  ·  5Comments

jancborchardt picture jancborchardt  ·  4Comments

HLFH picture HLFH  ·  3Comments

ChristophWurst picture ChristophWurst  ·  3Comments

benks-io picture benks-io  ·  4Comments