question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Someone else is editing" errors when no-one else is editing

See original GitHub issue

Issue Summary

We’ve had a number of reports where “Saving failed! Someone else is editing this post.” errors are shown when it’s not possible that anyone else was editing the post.

So far we have no reliable reproduction case although it does appear to occur more frequently on remotely hosted instances than local development instances.

My best guess at how this could happen:

  1. First save request is fired by the admin client and the server handling/response is delayed for some reason
  2. A second save request is fired (this could be through Cmd-S, an autosave, or editing a PSM field)
  3. Server handles/responds to the first request, updating the updated_at field
  4. Server handles/responds to the second request which at this point has an old updated_at value triggering the collision warning

The above scenario is much more likely to happen on systems that have occasional slow responses.

Reproduction steps

I’ve been able to use these steps to reproduce locally after tracing a production error and examining the logs for collision errors:

  1. Open a post in the editor
  2. Switch to “Slow 3G” throttling in Web Inspector
  3. Make a change to the post body
  4. Fairly quickly open the PSM then check the “feature” or “page” checkboxes
  5. 🤞 You’ll get a collision error

This is happening because the save routines in the post settings menu bypass the sequential saves in the main editor controller and so are prone to triggering the “best guess” scenario mentioned above.

TODO

  • evaluate debug logs
  • define a new save task in the editor base controller mixin that is exposed to the PSM component and replace all instances where the PSM saves the post model directly with the save task (https://github.com/TryGhost/Ghost-Admin/pull/901)
    • the new save task will be in addition to the current save task because the current task has additional publishing workflow requirements that the PSM inputs skip
    • the new save task will be part of the saveTasks group so that all save requests are queued to prevent collision errors

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:20 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
thecadamscommented, May 25, 2022

Hi folks, Possibly a new issue, but just had this again in Ghost 5.0!

1reaction
kevinansfieldcommented, Apr 16, 2018

👍 Any sort of caching for the /ghost/* route is likely to cause the collision error or other weird problems. We always recommend that the /ghost/* route is bypassed in Cloudflare or other caches/CDNs so that you don’t inadvertently serve stale data in API requests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"The document is locked for editing by another user" error ...
To resolve this issue, first confirm that another user on the network does not have the document open. If the document is in...
Read more >
Saving failed! Someone else is editing this post - Ghost Forum
Here's the error - 'Saving failed! Someone else is editing this post'. This error is displayed even when I'm the only person logged...
Read more >
Microsoft Teams: Someone Else is Editing This Section
If Microsoft Teams says that someone else is currently editing the section, make sure you're not signed in on two different devices.
Read more >
Cannot edit page when being edited by another user
If you have verified that no one else is editing the page, another possible cause of this message is when the Lock file...
Read more >
Error "This page was modified by someone else while you ...
This page was modified by someone else while you were editing it. Most likely it has been unlocked by a user with administrative...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found