Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excessive webhook triggers on dataset import #8241

Open
mtilda opened this issue Jan 12, 2025 · 1 comment
Open

Excessive webhook triggers on dataset import #8241

mtilda opened this issue Jan 12, 2025 · 1 comment

Comments

@mtilda
Copy link

mtilda commented Jan 12, 2025

Describe the bug

sanity dataset import triggers webhooks excessively.

To Reproduce

Steps to reproduce the behavior:

  1. Have a dataset with in-the-order-of a dozen documents in it.
  2. Have a webhook configured to trigger on Create, Update, and Delete.
  3. Export a copy of your dataset using sanity dataset export.
  4. At this point, you may need to modify the data in order to reproduce the behavior.
  5. Import your dataset using sanity dataset import (with the --replace flag to overwrite existing documents)

Expected behavior

Data should import and then trigger one webhook call.

Observed behavior

My webhook triggered 45 times in rapid (milliseconds) succession.

Impact

This has caused me to hit a rate limit with the service receiving the webhook, resulting in temporary denial of service.

Which versions of Sanity are you using?

Run sanity versions in the terminal and copy-paste the result here.

@sanity/cli (global)   3.57.0 (latest: 3.69.0)
@sanity/color-input     4.0.3 (up to date)
@sanity/icons          2.11.8 (latest: 3.5.7)
@sanity/image-url       1.1.0 (up to date)
@sanity/types          3.68.3 (latest: 3.69.0)
@sanity/ui            2.10.12 (latest: 2.11.1)
@sanity/vision         3.68.3 (latest: 3.69.0)
sanity                 3.68.3 (latest: 3.69.0)

What operating system are you using?

Debian GNU/Linux 12 (bookworm)

Which versions of Node.js / npm are you running?

Run npm -v && node -v in the terminal and copy-paste the result here.

10.9.0
v22.12.0
@cngonzalez
Copy link
Member

I'm sorry you experienced this, @mtilda ! In general, we recommend making your webhook filter as specific as possible. Sanity datasets include some internal documents, and also metadata for things like assets, AI Assist commands, tasks, and so on. I see you have some associated feature requests that look very valuable, and I'll respond to those as well.

We're happy to have a look at the way you've configured your webhooks and offer advice, but this may be expected behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants