Shopify / shopify-app-template-remix

374 stars 151 forks source link

Duplicated webhooks when migrating to declarative webhooks #805

Closed nullndr closed 3 months ago

nullndr commented 3 months ago

I am trying to migrate the webhooks registration process inside my app to the new declarative webhooks method.

With my suprise, webhooks are being triggered twice, it does not look like the new method register the topic on Graphql, so there is it and the already existing webhook subscription registration on Graphql that trigger the same webhook.

matteodepalo commented 3 months ago

Hi @nullndr, thank you for reporting this. This should be documented, but have you tried removing the webhook config code from the app? These two ways of configuring webhooks don't de-duplicate automatically.

nullndr commented 3 months ago

Hi @matteodepalo,

This should be documented, but have you tried removing the webhook config code from the app?

I have

These two ways of configuring webhooks don't de-duplicate automatically.

I am talking about already existing webhooks subscriptions, I have like ~4200 merchants that have already their webhooks subscription on GraphQL

matteodepalo commented 3 months ago

Hi @nullndr I found where a warning for this is documented https://shopify.dev/docs/apps/build/webhooks/subscribe#app-specific-subscriptions

Basically, if you want to have overlap and not miss webhooks, you should allow for some duplicates in your code and delete the existing webhook subscriptions after having deployed the config changes.

github-actions[bot] commented 3 months ago

We are closing this issue because we did not hear back regarding additional details we needed to resolve this issue. If the issue persists and you are able to provide the missing clarification we need, you can respond here or create a new issue.

We appreciate your understanding as we try to manage our number of open issues.