Post locking screen not always displayed
Quick summary
A dotorg install displays this dialog when two users try to edit the same page.
This dialog does not appear on dotcom. A similar one can be sometimes triggered.
Is the modal broken?
Once the dialog is being displayed, I think it's probably broken when using the calypso page/post editor.
The iframe bridge has some code related to making the post locking modal work across despite modals.
It assumes that the post locked dialog has three buttons but since https://github.com/WordPress/gutenberg/pull/37852 it only has two.
This means it's not overriding the all posts link to bust out the iframe and it's not modifying the take over button to add the frame-nonce.
Steps to reproduce
- Create a simple site and add an extra editor user to it
- As one user create a new post and save it as a draft. Leave this window open
- In a second profile/private window log in as the second user and then open the same draft as the other user has open.
What you expected to happen
A dialog to appear to the second user warning them that someone is already working on this page/post. Like the initial screenshot (made using a dotorg install).
What actually happened
Nothing, I could use the editor as normal.
Impact
One
Available workarounds?
Yes, easy to implement
Platform (Simple and/or Atomic)
No response
Logs or notes
In a dotorg install pressing 'Take over' will mean the original user will see a dialog warning them of this:
This dialog does eventually appear in dotcom, if you start typing in both windows.
Hey @dsas ! Would you like KitKat to replicate this further for you as part of triage? If so, I could use some info on what's expected/what's actually happening - I can't quite tell from the report above what to look for in that test. Once I know that, happy to test across Simple & Atomic to add further notes/screenshots!
Hey @cuemarie. Sorry, this was a problem I found while looking at some related code but couldn't get to the affected modal dialog as the user. I've explored the problem a little more and rewritten the issue to be more user-centric.
Much appreciated @dsas !
📌 REPRODUCTION RESULTS
- Tested on Simple – Replicated
📌 FINDINGS/SCREENSHOTS/VIDEO Replicated as described! I was never notified that someone was already editing a post. I did eventually run into the notification that "Someone else has taken over this post".
https://github.com/Automattic/wp-calypso/assets/27249804/373aea78-153f-4fc1-8315-6d72b991056a
📌 ACTIONS
- Triaged
I'm not sure why this is stripped out. This can be super handy in situations where multiple people are trying to edit a page/post. Otherwise edits can be lost.
I think this is on purpose in D49393-code and only limited to a12s as a way to prevent blocking users during support sessions.
I've tried to reproduce it with my test (non-a8c) accounts and I couldn't reproduce it.
Closing this. :)
@BogdanUngureanu, we're running some group triage at the moment and came across this issue. Did you resolve it as part of your Dotcom Groundskeeping rotation this week? Thanks!
@inaikem yes, I investigated it yesterday.