Skip to content

RTC: Move implementation from jetpack-mu-wpcom to generic package#47664

Merged
mmtr merged 15 commits intotrunkfrom
dotcom-16392-move-implementation-from-jetpack-mu-wpcom-to-jetpack-the
Mar 20, 2026
Merged

RTC: Move implementation from jetpack-mu-wpcom to generic package#47664
mmtr merged 15 commits intotrunkfrom
dotcom-16392-move-implementation-from-jetpack-mu-wpcom-to-jetpack-the

Conversation

@mmtr
Copy link
Copy Markdown
Member

@mmtr mmtr commented Mar 18, 2026

Fixes DOTCOM-16392

Proposed changes

  • Extracts the Real-time Collaboration (RTC) implementation from jetpack-mu-wpcom into a standalone automattic/jetpack-rtc package
  • The new package provides PingHub WebSocket transport for Gutenberg's RTC feature, including the PHP class (Automattic\Jetpack\RTC), REST API endpoint for PingHub JWT tokens, and the JS provider
    registration
  • jetpack-mu-wpcom now only hooks into jetpack_rtc_enabled to enable/disable RTC based on the WPCOM_Features::REAL_TIME_COLLABORATION feature flag, delegating all logic to the new package
  • In a follow-up PR, we'll create a new Jetpack module for self-hosted sites so they can get the WebSocket transport too.

Related product discussion/links

p58i-pRN-p2

Does this pull request change what data or activity we track or use?

No

Testing instructions

  • Simple sites
    • Apply these changes to your sandbox
    • Sandbox the API and a site with a Business plan
    • Make sure the site does not have the wpcom-features-edge sticker
    • Go to wp-admin/options-writing.php on the sandboxed site
    • Make sure the "Enable real-time collaboration" setting is not visible
    • Apply the wpcom-features-edge sticker
    • Make sure the "Enable real-time collaboration" setting is visible now
    • Enable the RTC setting (it should be enabled by default if you never change its value)
    • WebSocket transport
      • Open the same post in the editor with two different users
      • Observe the requests in the Network dev tools
      • Make sure there are no requests to the sync/updates endpoint
      • Make sure there is WebSockect connection to pinghub
      • Make sure the RTC feature works as expected (both uses can edit the post at the same time)
    • HTTP polling
      • Add this code to your 0-sandbox.php file: add_filter( 'jetpack_rtc_providers', function() { return array( 'http-polling' ); }, 100 );
      • Reload the post editor with the two users
      • Make sure there are requests to the sync/updates endpoint
      • Make sure there isn't a WebSockect connection to pinghub
      • Make sure the RTC feature works as expected (both uses can edit the post at the same time)
  • Atomic sites
    • Apply these changes to your WoW dev site
    • Make sure the site does not have the wpcom-features-edge sticker
    • Go to wp-admin/options-writing.php
    • Make sure the "Enable real-time collaboration" setting is not visible
    • Apply the wpcom-features-edge sticker
    • Make sure the "Enable real-time collaboration" setting is visible now
    • Enable the RTC setting (it should be enabled by default if you never change its value)
    • WebSocket transport
      • Open the same post in the editor with two different users
      • Observe the requests in the Network dev tools
      • Make sure there are no requests to the sync/updates endpoint
      • Make sure there is WebSockect connection to pinghub
      • Make sure the RTC feature works as expected (both uses can edit the post at the same time)
    • HTTP polling
      • Add this code to your 0-sandbox.php file: add_filter( 'jetpack_rtc_providers', function() { return array( 'http-polling' ); }, 100 );
      • Reload the post editor with the two users
      • Make sure there are requests to the sync/updates endpoint
      • Make sure there isn't a WebSockect connection to pinghub
      • Make sure the RTC feature works as expected (both uses can edit the post at the same time)

@mmtr mmtr self-assigned this Mar 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 18, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the dotcom-16392-move-implementation-from-jetpack-mu-wpcom-to-jetpack-the branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack dotcom-16392-move-implementation-from-jetpack-mu-wpcom-to-jetpack-the
bin/jetpack-downloader test jetpack-mu-wpcom-plugin dotcom-16392-move-implementation-from-jetpack-mu-wpcom-to-jetpack-the

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 18, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Mu Wpcom plugin:

  • Next scheduled release: WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2)

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2)

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@mmtr mmtr requested a review from rcrdortiz March 18, 2026 22:50
@mmtr mmtr added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Mar 18, 2026
@github-actions github-actions bot added [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Mar 18, 2026
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control bot commented Mar 18, 2026

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/jetpack-mu-wpcom/src/features/gutenberg-rtc/gutenberg-rtc.php 0/6 (0.00%) -58.75% -27 💚

2 files are newly checked for coverage.

File Coverage
projects/packages/rtc/src/rest-api/class-rest-pinghub-token.php 0/54 (0.00%) 💔
projects/packages/rtc/src/class-rtc.php 65/84 (77.38%) 💚

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

@mmtr mmtr added I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] In Progress labels Mar 18, 2026
@mmtr mmtr marked this pull request as ready for review March 18, 2026 23:49
@rcrdortiz
Copy link
Copy Markdown
Contributor

Works as expected on Simple sites. I'll continue testing on WoW sites.

Copy link
Copy Markdown
Contributor

@rcrdortiz rcrdortiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM let's go!

Copy link
Copy Markdown
Contributor

@arthur791004 arthur791004 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job 👍

@mmtr mmtr merged commit 857dd98 into trunk Mar 20, 2026
121 of 122 checks passed
@mmtr mmtr deleted the dotcom-16392-move-implementation-from-jetpack-mu-wpcom-to-jetpack-the branch March 20, 2026 09:35
@github-actions github-actions bot removed [Status] Needs Review This PR is ready for review. [Status] In Progress labels Mar 20, 2026
vianasw pushed a commit that referenced this pull request Mar 23, 2026
…7664)

- Extracts the Real-time Collaboration (RTC) implementation from `jetpack-mu-wpcom` into a standalone `automattic/jetpack-rtc` package                                                                         
- The new package provides PingHub WebSocket transport for Gutenberg's RTC feature, including the PHP class (`Automattic\Jetpack\RTC`), REST API endpoint for PingHub JWT tokens, and the JS provider            
  registration                                                                                                                                                                                                     
- `jetpack-mu-wpcom` now only hooks into `jetpack_rtc_enabled` to enable/disable RTC based on the `WPCOM_Features::REAL_TIME_COLLABORATION` feature flag, delegating all logic to the new package                
- In a follow-up PR, we'll create a new Jetpack module for self-hosted sites so they can get the WebSocket transport too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants