Closed brent-hoover closed 6 years ago
This is not a regression as it happens in master
/1.8.2
as well
This happens if you try to setup the sync again on the same address.
We see this because we keep resetting our databases which removes the history of webhook locally, but still use the same URL to pipe to localhost.
The acutal error is
address: [The address has already been taken]
Should we do something about this?
Does the API allow you to reset and then set the webhooks?
I agree with the change in impact status, but in the future try to put a note like "bumping down from major to minor because it only affects you when trying to set the hooks multiple times".
@zenweasel Why would we want to delete the webhook and then recreate the webhook with the same callback address?
Because it would make this idempotent.
To delete a webhook we need the Shopify's Id of the webhook. This id
is stored in the database. But if we are able to get the id
of the webhook, that means the webhook data was already present in the database and the control would never reach where new webhook is created.
So do we need to query to see if there is already an existing webhook and get that data?
We will have to make a request to get all the webhooks subscription for the shop. Then we can check if those already contain the webhooks we are trying to make and skip the creation accordingly.
That seems like a solid plan
Fixed by https://github.com/reactioncommerce/reaction/pull/4148 so I'm closing this.
Issue Description
Receive "Error setting up Shopify Sync" in browser and error in server console when enabling shopify inventory sync
Steps to Reproduce
Versions