Closed mheland closed 1 year ago
This is expected, the web hook is firing at the right time but you're modifying a post whilst it's still open in the editor and therefore causing the editor and the server state to become out of sync in the same way as if someone else was editing the post. In this case someone else is editing the post, it's just that it's a bot rather than a real person.
Whilst a post is a draft any changes are continually saved, each of those saves will trigger the post updated web hook.
Having an external tool modifying a post on every save will always cause this issue. I would suggest updating your external integration to only make changes when a post is published, although even then you'll run into the same issue if you continue to make changes in the editor after publishing. The web hooks system is designed to trigger changes in external systems, not to facilitate modifications of posts/pages whilst they are being edited.
Hi Kevin, the strange thing is that the integration/hooks works on my VPS, does not generate a Edit Lock error, the integration updates Twitter/Facebook cards in the background on every save/update, even when in Draft mode, and when editing published posts.
On GhostPro / digitalpress.blog hosting enabling the integration throws the Edit Lock error.
I'm talking to the people who made the integration (placid.app) - are there any new flags in the admin-API v3 to not request an edit lock or similar?
Possibly related to GhostPro / digitalpress.blog using storage adapters and CDN's?
I can't explain how it's working on your VPS because if what you say the integration is doing is successful it will always break the ability to edit posts if it does it's thing whilst the post is open in the editor. Storage adapters, CDNs, or specific hosting setups won't have any effect as the out-of-sync detection is part of Ghost's core.
The flow looks like this:
updated_at
value that matches what's on the serverupdated_at
value to update on the server - there's no way for the admin area to know about this changeupdated_at
value that it got in step 1Thank you, seems I have an edge-case. Reminds me of previous job with Linux digital signage hardware where we had random reboots. A Linux kernel dev at $200/hr in a room with 50 mediaplayers, waiting for the the reboot to trigger on one of them. We called it the Neutrino Observatory. Pls close this and I'll continue talking to Placid to see if we can fix this. Tx /m
Issue Summary
Alternate heading: "Trigger happy Ghost shoots itself in the foot"
When integrating external services it appears that Ghost fires the Page Updated / Post Updated webhook before the save is fully completed. If the integration immediately modifies the Post/Page over admin-API v3 Ghost will generate a Edit Lock error and post can not be saved.
Have been able to replicate this on GhostPro & digitalpress.blog hosting - does not happen on a single-ghost-no-cdn VPS installation DigitalOcean/Hetzner etc...
Steps to Reproduce
Expected results: Post / Page is updated. Actual results: Ghost reports Edit lock - "Someone else is editing this page" unable to save edits. Disabling the webhook resolves the problem.
Ghost Version
5.68.0
Node.js Version
Docker on my VPS ghost:5-alpine
How did you install Ghost?
VPS - Docker / Debian
Database type
MySQL 8
Browser & OS version
No response
Relevant log / error output
Code of Conduct