Repository navigation
Editor: Register the write blocker before disable-features runs - #81
Merged
Merged
Conversation
#77 sets the isComplementaryAreaVisible preference when disable-features loads. The preferences persistence layer sends its first save immediately (its debounce fires on the leading edge), and disable-features loaded before editor-modifications.js, so that PUT /wp/v2/users/me went out before the write blocker was registered: a 404 for every logged-out visit, and a real write of persisted_preferences user meta for logged-in visitors. Make disable-features depend on editor-modifications so the blocker is in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found during final checks on trunk after #71–#80.
Problem
Every front-page load sends a real
PUT /wp/v2/users/me, the preferences save that the write blocker injs/editor-modifications.jsis supposed to stop:rest_user_invalid_id, user 0). It's harmless, but it's a server request on every visit.wp_persisted_preferencesuser meta for that visitor on the Frontenberg site.The cause: #77 sets the
isComplementaryAreaVisiblepreference at the top level ofplugins/disable-features/index.js. The preferences persistence layer debounces its saves, but its debounce fires on the leading edge, so the first save goes out immediately.disable-featureswas enqueued beforeeditor-modifications, so that firstPUTran before the write blocker was registered. Later saves are blocked, because the blocker is in place by then.Fix
Add
editor-modificationsas a dependency ofplugin-disable-features-js, so the write blocker is always registered beforedisable-featuresruns.Testing
Chrome, local wp-env on WP 7.2-beta1:
users/merequests on loadusers/merequests on loadwp_persisted_preferencesmeta after loadlocalStorageProduction note
Since #77 was deployed, logged-in wordpress.org users who visited /gutenberg/ may have
wp_persisted_preferencesmeta on that site. It only holds editor UI preferences, such as the sidebar being closed and the welcome guide being dismissed. If you want to clean it up, it can be deleted.🤖 Generated with Claude Code