When a user opens a post editor, two presence entries are written to the same post room:
editor-{user_id} by the editor heartbeat handler (includes/heartbeat.php:108-116)
lock-{user_id} by the post-lock bridge (includes/post-lock-bridge.php:49-56)
Both store identical data: same room, same user, same { action: 'editing', screen: ... }. They differ only in the client_id prefix. wp_get_presence() returns both, undocumented, with no way to tell them apart except by parsing that prefix.
The one signal the split encodes is post-lock liveness, since the two rows are refreshed by different heartbeat keys and age out independently.
Proposed fix
Merge into one editor-{user_id} entry with a locked boolean in the state data. The bridge writes into the existing entry instead of creating a row.
Knock-ons:
If rejected
#21 is a live bug, PR #78 is its fix and should be unblocked. This issue then narrows to adding an explicit type field so callers stop parsing client_id.
Sequencing
#135 moves this same inline script to a file. Land it after this and PR #78.
When a user opens a post editor, two presence entries are written to the same post room:
editor-{user_id}by the editor heartbeat handler (includes/heartbeat.php:108-116)lock-{user_id}by the post-lock bridge (includes/post-lock-bridge.php:49-56)Both store identical data: same room, same user, same
{ action: 'editing', screen: ... }. They differ only in theclient_idprefix.wp_get_presence()returns both, undocumented, with no way to tell them apart except by parsing that prefix.The one signal the split encodes is post-lock liveness, since the two rows are refreshed by different heartbeat keys and age out independently.
Proposed fix
Merge into one
editor-{user_id}entry with alockedboolean in the state data. The bridge writes into the existing entry instead of creating a row.Knock-ons:
includes/heartbeat.php:80-83registerslock-{user_id}for thepagehideDELETE. That goes away.If rejected
#21 is a live bug, PR #78 is its fix and should be unblocked. This issue then narrows to adding an explicit
typefield so callers stop parsingclient_id.Sequencing
#135 moves this same inline script to a file. Land it after this and PR #78.