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

Deletion via Webhook not working #104

Closed
klickreflex opened this issue Jan 16, 2022 · 11 comments
Closed

Deletion via Webhook not working #104

klickreflex opened this issue Jan 16, 2022 · 11 comments

Comments

@klickreflex
Copy link

klickreflex commented Jan 16, 2022

I've setup Webhooks as in the docs (2022-01 latest), when I delete a product from Shopify it's not deleted from Statamic. Instead Horizon shows a failed Task:

Jackabox\Shopify\Jobs\FetchCollectionsForProductJob
ID
15ae5772-671c-4412-9913-c145180e546d
Queue
default
Attempts
3
Retries
0
Tags
Pushed At
2022-01-16 13:35:57
Failed At
2022-01-16 13:56:21
Exception
PHPShopify\Exception\ApiException: Not Found in /home/forge/stage.crazyceramic.klick.re/vendor/phpclassic/php-shopify/lib/ShopifyResource.php:559
Stack trace:
#0 /home/forge/stage.crazyceramic.klick.re/vendor/phpclassic/php-shopify/lib/ShopifyResource.php(347): PHPShopify\ShopifyResource->processResponse()
#1 /home/forge/stage.crazyceramic.klick.re/vendor/jackabox/statamic-shopify/src/Jobs/FetchCollectionsForProductJob.php(65): PHPShopify\ShopifyResource->get()
#2 /home/forge/stage.crazyceramic.klick.re/vendor/jackabox/statamic-shopify/src/Jobs/FetchCollectionsForProductJob.php(49): Jackabox\Shopify\Jobs\FetchCollectionsForProductJob->loopCollections()
Show All
@jackabox
Copy link
Collaborator

Hey, what do you mean 2022-01? The webhook should be set up as the add-on docs which specifies the end point to be posted too.

How have you implemented these ?

@klickreflex
Copy link
Author

Docs state it shoud be 'latest', Shopify shows 2022-1 prefix for 'latest' ('neueste' in german)
image

@klickreflex
Copy link
Author

But maybe my problems are related to #95. Will have to check deletion with my current workaround next week.

@jackabox
Copy link
Collaborator

jackabox commented Jan 17, 2022 via email

@klickreflex
Copy link
Author

Not sure with your message and 1eade64:

Should I still downgrade to api v2021-07 even when upgrading to 1.7?

@jackabox
Copy link
Collaborator

Not sure with your message and 1eade64:

Should I still downgrade to api v2021-07 even when upgrading to 1.7?

Nope, tested on latest version and all should be working fine :)

@klickreflex
Copy link
Author

Awesome, thank you 🙏

@klickreflex
Copy link
Author

Just after lauching I had to find out that deletion does not work after all.
It seems like it worked because products disappeared from the backend, but the actual markdown files were kept (with only the id and blueprint being kept), causing for all sorts of issues in collection queries where they still appear as empty entries.

Here's how thoese files look like:

image

@klickreflex
Copy link
Author

I have to correct myself after investigating Git history. Deletion did work, but somehow those "ghost" files were automatically recreated (depending on the products days or hours) later:

CleanShot 2022-01-20 at 20 43 48@2x

Any ideas what could have caused this, and obviously how to prevent it in the future?

@jackabox
Copy link
Collaborator

@klickreflex There's nothing directly that would cause a ghost file to be created. Can you try to replicate it in your local environment also and let me know if it exists? If so I'll try and do a bit more debugging. However, I'm not getting ghost files in my test environments so not sure what's going on here. Although, I am not using git integration to recommit on file save.

@klickreflex
Copy link
Author

I can't because I don't receive Webhooks locally and the site is live now.

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