Skip to content

Conversation

@shekharnwagh
Copy link
Contributor

@shekharnwagh shekharnwagh commented Jan 23, 2026

What?

Improves sync connection state handling added in #74075 by fixing event name conflicts and ensuring the disconnection modal displays in all disconnect scenarios.

Why?

Two issues were discovered when integrating with the WebSocket provider - Automattic/real-time-collaboration#145:

  1. Event name conflicts: The WebSocket provider has a built-in 'status' event that conflicts with our sync connection status event. These default WebSocket events don't include custom fields like 'error', causing issues when our custom SyncConnectionState events overlap with them.

  2. Hidden disconnections: The sync connection modal only appeared when connectionState.error existed. This meant users could be disconnected without seeing any indication if the disconnection didn't include a specific error object, leading to confusion about why editing was disabled.

How?

  • Renamed the provider event from 'status' to 'sync-connection-status' to avoid conflicts with WebSocket provider events
  • Changed modal condition to check status !== 'disconnected' instead of checking for error presence

Renamed the event from 'status' to 'sync-connection-status' to make
it unique and avoid conflicts. This ensures sync-specific connection
state events are distinct from generic provider status events.
Previously, the modal only appeared when connectionState.error existed.
This meant users might be disconnected without seeing any indication if
the disconnection didn't include a specific error object.
@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: shekharnwagh <shekharnwagh@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@chriszarate chriszarate added [Type] Bug An existing feature does not function as intended [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration labels Jan 23, 2026
@chriszarate chriszarate self-requested a review January 23, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Package] Editor /packages/editor [Package] Sync [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants