You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collaboration: Deduplicate awareness query for client_id ownership check
check_permissions() called get_awareness_state() to validate client_id
ownership, then process_awareness_update() called the exact same query
to build the response. Both used the same 30s timeout.
Moves the ownership check into process_awareness_update() so a single
get_awareness_state() call serves both purposes. The method now returns
WP_Error on ownership violations, checked in handle_request().
The current client's awareness state is run through wp_json_encode /
json_decode to match the round-trip path other clients' states take
through the DB, preventing inconsistencies from encoding normalization.
Note: ownership validation now runs per-room inside handle_request()
rather than for all rooms upfront in check_permissions(). In a
multi-room request where room 2 has a conflict, room 1's awareness
upsert will have already completed. This is acceptable because
awareness upserts are idempotent heartbeats.
Saves 1 query per room per poll.
0 commit comments