Forum Discussion

AEmery's avatar
AEmery
Explorer | Level 3
8 years ago

Renamed shared folder reported both as new and deleted by /list_folder/continue

Hello Greg,

 

Found a strange behavior with /list_folder/continue that you might be able to clarify. Here's how to reproduce:

- Using /list_folder/continue until you get the last cursor.

- Rename a shared folder (here "OldName" to "NewName")

- Calling /list_folder/continue with the last cursor gives me this:

{
        "entries": [
            {
                ".tag": "deleted",
                "name": "oldname",
                "path_lower": "/oldname",
                "path_display": "/oldname"
            },
            {
                ".tag": "deleted",
                "name": "newname",
                "path_lower": "/newname",
                "path_display": "/newname"
            },
            {
                ".tag": "deleted",
                "name": "OldName",
                "path_lower": "/oldname",
                "path_display": "/OldName"
            },
            {
                ".tag": "folder",
                "name": "NewName",
                "path_lower": "/newname",
                "path_display": "/NewName",
                "id": "id:FolderId",
                "shared_folder_id": "1479396978",
                "sharing_info": {
                "read_only": false,
                "shared_folder_id": "sharedFolderId"
            }
        }
    ],
    "cursor": "someCursor",
    "has_more": true
}

 

Two things looks strange to me here. I get the OldName twice: with and without casing. This I can manage, but the Folder "NewName" being returned both as deleted and as a new folder is more of a problem. Is it an expected behavior?

 

Also, this is a behavior that I can reproduce using APIv1 /delta with a cursor. Renaming a simple (not shared) folder returns simply one entry for the deleted OldName and one for the NewName as I was expecting.

 

Thank you for your help.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    Thanks for the report! I'm seeing the duplicate "/oldname" in my testing, but not the extra deleted "/newname", though I expect it will depend on the particular state of the account. In this sample, did you previously have anything at "/newname" by any chance?

    We'll look into whether or not we can clean this up, but the entries as shown here should still give you the correct state as long as you process them in order according to the rules indicated in the /files/list_folder documentation:

    https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder

    I.e., Per "If there's nothing at the given path, ignore this entry.", you should make sure your app is able to ignore any such entries, such as these redundant deleted ones.
    • AEmery's avatar
      AEmery
      Explorer | Level 3

      Good point, I did not think about this name having ever been used. So, to be sure I did the same test again with both old and new names being random strings that surely has never been used in the whole account. I get the same behavior.

       

      The processing order is hard to enforce when working in a threaded context so having both a new and a deleted folder might result in an unpredictable behavior.

       

      Anyway, thank you for the quick feedback and I'll be happy to help if you need more context to be able to replicate this behavior.

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff
        Thanks! We'll look into it.

        Note that is is important that your app process these entries in order. Otherwise, you may not get a state consistent with the state on the Dropbox servers.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,944 PostsLatest Activity: 37 minutes ago
351 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!