Forum Discussion

minamiSasaki's avatar
minamiSasaki
Explorer | Level 3
6 years ago

"has_more = true" was returned even though "files / list_folder" was less than "limit".

I tried to get information about all files and folders in my account.
I restricted the number of acquisitions by "limit".So I tried to get the rest by " / list_folder / continue", when I cannot get all.
However, "has_more=true" was returned returned, despite being less than the "limit".
Is this a bug in Dropbox?


Response example (42 items in total)
{
"entries": [
{
".tag": "folder",
"name": "test",
"path_lower": "/test",
"path_display": "/test",
"id": "id:dummy_id_aaaaa"
},
{
".tag": "folder",
"name": "test_folder",
"path_lower": "/test_folder",
"path_display": "test_folder",
"id": "id:dummy_id_bbbbb"
}
],
"cursor": "dummy_cursol_ccccc",
"has_more": true
}

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Thanks for the report. This sort of thing can happen when using /2/files/list_folder[/continue], and while it's not a bug, we do understand it's not ideal.

    The limit the client supplies is only a guideline, and the API may not always be able to actually follow it. Because of how the Dropbox filesystem works on the backend, sometimes the API may return less than the limit, and sometimes it may actually return a little more.

    There's some information about this in the docs for the param:

    limit UInt32(min=1, max=2000)? The maximum number of results to return per request. Note: This is an approximate number and there can be slightly more entries returned in some cases.

    That's to point out that the value is only meant as a maximum, so the API can still return less than the specified value (but also sometimes more).

    So, all of that being the case, the client always needs to check the has_more value and call back to /2/files/list_folder/continue if it's true.