You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
rodriguezo
2 years agoExplorer | Level 3
get_last_cursor() is constantly changes
Hello,
In my application I've implemented this logic in order to reduce significatly the traffic, but get_last_cursor() doesn't seem to work properly.
- I store the cursor from my last list_folder/continue recursive call to a specific path.
- Webhook get triggered by Dropbox, so I call get_last_cursor() at the same path.
- I compare the retrieved cursor with the stored one, if not matching, I proceed to update the information with list_folder/continue with the OLDER stored cursor set at the same path.
- After information update, repeat from point 1.
Issue: In the next call get_last_cursor() result always changes so It's also never matching my stored cursor, even if no edit nor API calls has been done at the specified path, making the optimization worthless.
I also tried to store the cursor from an extra get_last_cursor() call just after the recursive call from last list_folder/continue, but with same result.
From api docs "A way to quickly get a cursor for the folder's state.", but looks like the folder's state is constantly changes, even if it's not.
How can I solve?
Thanks in advance.
Hi rodriguezo,
You have conceptual mistake. Cursor (including the last one) represent somehow particular enumeration state. It's an opaque object and you shouldn't suppose existence of any features that are not explicitly supported (that what you are actually doing)! Where did you read that cursors are comparable? 🧐 Actually, they are not and you should use them as arguments to appropriate APIs only (as described in the documentation). 😉 Even more: in your particular case you don't need the last cursor. It's clear what you are trying to optimize, but (as I mentioned) it's impossible.
Hope this clarifies matter.
- ЗдравкоLegendary | Level 20
Hi rodriguezo,
You have conceptual mistake. Cursor (including the last one) represent somehow particular enumeration state. It's an opaque object and you shouldn't suppose existence of any features that are not explicitly supported (that what you are actually doing)! Where did you read that cursors are comparable? 🧐 Actually, they are not and you should use them as arguments to appropriate APIs only (as described in the documentation). 😉 Even more: in your particular case you don't need the last cursor. It's clear what you are trying to optimize, but (as I mentioned) it's impossible.
Hope this clarifies matter.
- rodriguezoExplorer | Level 3
Hi @Здравко thank you for your reply,
Following th API Docs here :A way to quickly get a cursor for the folder's state. Unlike list_folder, list_folder/get_latest_cursor doesn't return any entries. This endpoint is for app which only needs to know about new files and modifications and doesn't need to know about files that already exist in Dropbox
Now I'm a bit confused, in which way this cursor, or in general this endpoint, is working in order to retrieve updated information about new files and modification?
Thanks
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 3 years agoIf 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!