Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Timm S.'s avatar
Timm S.
New member | Level 1
9 years ago

A way to delayed webhooks or determine when a sync operation is completed?

I'm integrating Dropbox with GotDone, the time tracking assistant that helps you keep track of everything you've worked on automatically.

I'm running into an issue with webhooks, particularly when sync operations take a long time with lots of changes are triggered.

As an example, I'm deleting a single 'node_modules' folder (~15K files). Immediatly, Dropbox starts firing webhooks my way, for several minutes (screenshot illustrates the problem).

Ideally, I'd like to wait until the sync operation completed before receiving any webhooks. Is that possible?

If not, what is the best way for me to determine when the operation is complete on Dropbox' end? 

3 Replies

Replies have been turned off for this discussion
  • Richard P.'s avatar
    Richard P.
    Icon for Super User alumni rankSuper User alumni
    9 years ago

    The problem you really have is that Dropbox sees each separate file action as a "sync operation", hence you receiving a webhook event for each file being deleted - if you want to fudge a concept such as a transaction onto the way Dropbox works then you arent really going to have much luck Im afraid.

    You are going to have to determine a period of time which constitutes an "end of sync" which suits you, and just assume it that way when no more callbacks are fired within that period.

  • Timm S.'s avatar
    Timm S.
    New member | Level 1
    9 years ago

    Thanks for the input, Richard. That certainly wasn't what I was hoping for, but it makes sense based on my understanding of the API. 

    I'm still very interested in possible workarounds or tips/tricks for dealing with this, in case anyone else has input :)

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    Hi Timm, Richard's correct, the Dropbox API doesn't exactly have a concept of a sync being "done". When the Dropbox servers receive a change, (e.g., a single file upload via a single API call) it just sends off a webhook notification to let you know about it. Dropbox doesn't know if there are further changes coming, so it doesn't know to hold off on webhook notifications.

    If you want to batch things together on your side, I would also recommend you "debounce" the notifications like Richard described.

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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, Facebook or Instagram.

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!