We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.

Forum Discussion

pcooperuk's avatar
pcooperuk
Explorer | Level 3
4 years ago

Dropbox, webhooks, continue, 20,000+ folders

So I have setup dropbox, have everything working well, have also setup webhooks to notify that a unknown change has happened.

Here is my problem, the dropbox instance has 22,000+ folders inside it.

 

There is absolutely no way I can efficiently process this volume of /folder/continues just for example if one file / folder has changed.  It makes Zero sense.

 

What is the solution, or is it impossible to truly detect a single file / folder change and efficiently process that change?

 

There is no way to identify the change, all I can do is call listfolder/continue on every single folder which makes the dropbox API pretty much useless in instances where there are a very large number of folders.


  • pcooperuk wrote:

    ..., have also setup webhooks to notify that a unknown change has happened.

    ... no way I can efficiently process this volume of /folder/continues just for example if one file / folder has changed.  ...

    ...

    There is no way to identify the change, all I can do is call listfolder/continue on every single folder ...


    Hi pcooperuk,

    Seems you haven't read very careful the Dropbox API documentation! 🙂 Are you aware what list cursor is?! 🧐 The same cursor your are using with "listfolder/continue" calls. Seems you are not aware, so I will make a brief review. The cursor iterates over the records in sequence described by the last action happened on every listed entry (latest changed entries are last in the list). Yes, if you are running listing anew every time, all entries will get enumerated in the order just described (of course). That's truly meaningless! That's why you have to keep your last iterator and on next event use the stored iterator to continue from, not anew. 😉 In such a way only changed entries gonna be listed. Even more, to avoid enumerate every one folder in your account explicitly, you can initiate recursive listing on the account root and use the returned cursor in your webhook handler. 😜

    Hope this clarifies matter.

  • Здравко's avatar
    Здравко
    Legendary | Level 20

    pcooperuk wrote:

    ..., have also setup webhooks to notify that a unknown change has happened.

    ... no way I can efficiently process this volume of /folder/continues just for example if one file / folder has changed.  ...

    ...

    There is no way to identify the change, all I can do is call listfolder/continue on every single folder ...


    Hi pcooperuk,

    Seems you haven't read very careful the Dropbox API documentation! 🙂 Are you aware what list cursor is?! 🧐 The same cursor your are using with "listfolder/continue" calls. Seems you are not aware, so I will make a brief review. The cursor iterates over the records in sequence described by the last action happened on every listed entry (latest changed entries are last in the list). Yes, if you are running listing anew every time, all entries will get enumerated in the order just described (of course). That's truly meaningless! That's why you have to keep your last iterator and on next event use the stored iterator to continue from, not anew. 😉 In such a way only changed entries gonna be listed. Even more, to avoid enumerate every one folder in your account explicitly, you can initiate recursive listing on the account root and use the returned cursor in your webhook handler. 😜

    Hope this clarifies matter.

About Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,875 PostsLatest Activity: 2 years ago
323 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!