Skip to content

[WIP] Collaboration: Migrate real-time storage from post meta to custom tables#11229

Draft
josephfusco wants to merge 12 commits intoWordPress:trunkfrom
josephfusco:feature/collaboration-data-refactor
Draft

[WIP] Collaboration: Migrate real-time storage from post meta to custom tables#11229
josephfusco wants to merge 12 commits intoWordPress:trunkfrom
josephfusco:feature/collaboration-data-refactor

Conversation

@josephfusco
Copy link

@josephfusco josephfusco commented Mar 11, 2026

Summary

Replaces the post meta-based storage backend for real-time collaboration with dedicated wp_collaboration and wp_awareness database tables, improving query performance and eliminating post meta pollution.

  • Adds wp_collaboration and wp_awareness tables with a upgrade_700() schema migration
  • Introduces WP_Collaboration_Storage interface and WP_Collaboration_Table_Storage implementation
  • Replaces WP_HTTP_Polling_Sync_Server with WP_HTTP_Polling_Collaboration_Server
  • Adds wp_is_collaboration_enabled() feature gate (checks both option and db_version)
  • Adds cron-based cleanup for stale collaboration and awareness rows
  • Removes the wp_sync_storage post type and legacy sync classes

Create wp_collaboration and wp_awareness tables for storing real-time
collaboration data. Register new table properties on wpdb and bump
wp_db_version to trigger the upgrade routine.
Introduce WP_Collaboration_Storage interface and
WP_Collaboration_Table_Storage implementation that persists
collaboration and awareness data to the custom database tables.
Introduce WP_HTTP_Polling_Collaboration_Server REST controller that
handles document syncing and presence awareness via HTTP long-polling.
Remove the old WP_Sync_Post_Meta_Storage, WP_HTTP_Polling_Sync_Server,
and WP_Sync_Storage interface, replaced by the new collaboration-namespaced
classes in previous commits.
Add wp_is_collaboration_enabled() gate that checks both the option and
db_version. Add wp_delete_old_collaboration_data() cron handler. Update
wp-settings.php require paths, rest-api.php instantiation, and
default-filters.php hooks to use the new collaboration classes. Remove
the wp_sync_storage post type and fix get_post() guard.
Add comprehensive PHPUnit tests for WP_HTTP_Polling_Collaboration_Server
covering updates, awareness, permissions, and schema validation. Remove
the old sync server tests. Update autosaves and schema-setup tests for
the collaboration feature gate changes.
Add end-to-end tests covering document sync, presence awareness, and
undo/redo behavior for real-time collaboration.
@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@josephfusco josephfusco changed the title Collaboration: Migrate real-time storage from post meta to custom tables [WIP] Collaboration: Migrate real-time storage from post meta to custom tables Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant