We are working for the past couple of months on a new Shopify App that is build on our existing product SmartSearch (happy to give a preview to anyone who's interested btw!).
Basically we enhance your search with machine learning, autocomplete, filters, business rules etc to drive more conversions (search is a very important driver!). Our app takes over your default search with our results. The style (colors, fonts etc) of these results are adapted to your shop. On install we can read those by looking at your current main theme and copy some values.
We subscribe to the webhook 'theme/update' but this only fires on adding a complete new design (eg theme switch). If you change colors, fonts etc we don't get a webhook post to our backend. (try to change a color in for example the 'debut' theme and check if the webhook is fired)
I would expect that 'theme/update' would fire on all update events in a theme.
Sure, we can 'fix' this by either polling the theme endpoint every minute/hour/... or make a explicit button in our app to 'sync' the design with our app (we chose the latter for now).
Is there a way that we can get small(er) theme updates through a webhook (preferably 'theme/update')?
The best way to keep up on theme updates at the moment is by polling for changes at certain time intervals (or when someone clicks a button and tells you to do it), though I can personally agree this is probably not the most ideal.
I've brought this up with our engineers here, I'm just waiting to see if this is a matter that we can all agree on or not. If I hear back with some news to pass along I'll try to keep you posted!
No updates as of yet. Though the issue has been raised with our developers, it doesn't come up often and our priorites are currently in other areas. I think it's more likely that you'll see a separate webhook topic for this in the future if anything, but it isn't something currently being worked on.
I'd ask why you need this kind of webhook?
I'd also add that the theme/update topic wouldn't be the right one for asset changes. I'd expect theme/update to fire only when theme related fields or meta info change.
Assets to not have any kind of webhooks and I am not sure why we'd need them?
In general, for asset change tracking I'd even vote against webhooks just to avoid the mess app vendors would make from abusing this for auto-updating / syncing / preventing user changes / I am sure they'd come up with many more "creative" uses.
Jyst some thoughts - still curious why we'd need the asset update topic on webhooks?
Thanks Karl for your insights :)
I copy the page.liquid, and create a seperate liquid which includes the original content of page.liquid, plus additional lines. As I cannot include whole liquid files, only templates, I think I cannot do this other way.
And I would like to track modifications of the original page.liquid file, and update our copy liquid when modified. Yes, I can poll for modifications on this file, but it's not convenient.
Still not sure why you need to poll or detect changes when the changes occur. Would it not be enough to copy page.liquid, create a SHA hash, store in some version / lock file, apply changes and re-create SHA hash upon successful update on remote.
Now each time you have an update to push, you download the page.liquid, compare hash to last known hash. If they aren't equal use diff to resolve and apply your changes - if it fails, you can still resolve manually.
It's basically a similar or same process used by Themekit. But that's also assuming you are okay to resolve when you are ready to make changes, not vice versa, resolve when user has made changes to the page.liquid.
I'd also try to keep the "app changes" to page.liquid to a minimum and use snippet / includes i.e. 1 liners if possible because that would make the entire conflict resolution a whole lot easier when users do change something.
Just a few thoughts though I am sure your use case may be very different and those webhook topics might actually benefit you.
Sorry to bump the old thread, but an effective reason to detect changes is when there is multiple people working on the site that aren't developers but still need to edit pages, install apps, etc. As such, a single activity pane where I can see entries like "John edited theme.layout at [Time]" or "Karl edited Theme Settings > Cart settings at [Time]" would be very useful for staying up to date on all the changes being made in the production store.
What you described is basically the hard way of doing it, where as a web hook would save you the time of implementing the solution you suggest. (And I do agree with you on the dangers this may pose as well).