Repository navigation
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Thanks, @chubes4! The problem isn't unique to block notes; it affects any block attribute that hasn't been saved. I was hoping we could piggyback on the new RTC functionality and have some kind of method to fix these missing items. While similar band-aid fixes work, they're not ideal and introduce an odd pattern in the public codebase. I did a surface-level review, and here are some potential issues:
I like the exploration, but I don't think this is the right way to solve the problem. |
|
@Mamaduka Thanks! I'll take it back to the lab. This PR resulted from experiments with deterministic benchmarking. It feels like a promising way to diagnose and prove complex WordPress problems like this. I'll try another approach and push an updated attempt later. |
|
Thanks for the push here. I reworked this away from the Notes-specific save path. The updated approach adds a private core-data repair path that persists targeted block attribute changes for a sync-enabled entity. Notes now only supplies the I also expanded the reusable Homeboy/WP Codebox coverage to prove the behavior beyond the happy path: clean live note creation, dirty same-block text, dirty structural insertion before the target block, and rapid double note creation preserving all note IDs. The focused build/lint/unit checks and those trace profiles pass locally on the updated branch. |
|
@chubes4 looks like the persistEntityBlockAttributes test is failing, could you take a look? |
|
@adamsilverstein Yes, taking a look and also fuzzing this with adversarial scenarios. Will push an update soon. Thank you! |
|
@adamsilverstein The remaining Core-backport check is a false positive from the changed Could a maintainer add References: |
# Conflicts: # packages/core-data/src/private-actions.js
Added. |
|
@adamsilverstein Thank you! This became a rabbit hole. Once I started fuzzing it, bugs popped up all over the place. I fixed a ton of them. Still would like to run a few more tests. This gets complicated quick when you have a lot of users on the page. |
|
@adamsilverstein The additional multi-user/adversarial testing is complete at current head Final exact-head campaign
The 21 operations cover missing/saved anchors; clean, dirty, nested, repeated, and inline creation; invalid/ambiguous/empty saved content; store coherence; seeded repair/save ordering; CRDT peer lineage; forced repair recovery; overlapping repairs; pending inline edits; 12 independently authenticated authors; conditional content/CRDT atomicity; and independent PHP-worker/MariaDB-session atomicity. Reproduction from the corpus PR checkout with this built Gutenberg checkout: homeboy extension setup wordpress
HOMEBOY_COMPONENT_PATH=/path/to/gutenberg \
HOMEBOY_WORDPRESS_HELPER_MANIFEST="$HOME/.config/homeboy/extensions/wordpress/lib/helper-manifest.js" \
WP_CODEBOX_RUNTIME_MODULE="$HOME/.cache/homeboy/wp-codebox/source/packages/runtime-core/dist/index.js" \
HOMEBOY_SEED=1 \
node WordPress/gutenberg/fuzz/gutenberg-notes-unsaved-attachment.mjsTogether with the green Gutenberg-native CI at this head, no fuzz finding remains open. |
# Conflicts: # packages/editor/src/components/collab-sidebar/hooks.js
|
Let's punt this to 7.2. |
|
I split this work into six focused draft PRs so each synchronization invariant can be reviewed and landed independently:
The drafts target The original review findings and adversarial evidence remain recorded in this PR. The replacement stack preserves those fixes and adds one focused Gutenberg-native Playwright regression per layer, with the Block Notes integration retaining the attachment scenarios requested in the review. AI assistance: GPT-5.6 Sol via OpenCode assisted with splitting the implementation, adding repository-native regression coverage, and verifying the replacement stack. Chris reviewed and is responsible for the submitted changes. |
What?
Fixes top-level Block Notes becoming detached when the editor is reloaded before the user manually saves the post.
Why?
Creating a top-level note persists its comment immediately, but its block attachment lives in
post_contentasmetadata.noteIdand, for inline notes, acore/notemarker. Previously those changes could remain only in editor memory, so the durable comment reopened as detached.Persisting the attachment must not save unrelated dirty post edits or replace the collaborative document lineage.
How?
metadata.noteIdand any inlinecore/notemarker to the loaded sync-manager CRDT document.post_contentand_crdt_documenttogether through/wp-sync/v1/save, then ingest the returned entity into core-data.There is no fallback to a full post save, so unrelated dirty edits remain unsaved. Occurrence-aware matching handles duplicate and contentless blocks, while divergent paths fail safely.
Testing Instructions
Clean post:
Dirty post safety:
Automated coverage includes duplicate contentless blocks, inline markers, divergent dirty paths, failed-repair behavior, CRDT peer lineage, and competing sync-save ordering.
Evidence
b39a5c1ce18, seed1, with zero findings.Fixes #72717.
AI assistance