cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: get_last_cursor() is constantly changes

get_last_cursor() is constantly changes

rodriguezo
Explorer | Level 3
Go to solution

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.

 

  1. I store the cursor from my last list_folder/continue recursive call to a specific path.
  2. Webhook get triggered by Dropbox, so I call get_last_cursor() at the same path.
  3. 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.
  4. 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.

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20
Go to solution

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.

View solution in original post

2 Replies 2

Здравко
Legendary | Level 20
Go to solution

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.

rodriguezo
Explorer | Level 3
Go to solution

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_folderlist_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

Need more support?