Repository navigation
fix: restore content-change notifications to the host - #744
Merged
dcalhoun merged 1 commit intoSep 30, 2026
Merged
Conversation
dcalhoun
force-pushed
the
fix/autosave-monitor-interval
branch
from
September 29, 2026 15:00
36d286d to
14c7b71
Compare
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/744")Built from 989b3fa |
1 task done
`@wordpress/editor` 15 skips autosave checks when no interval is set. Hosts never provide the `autosaveInterval` setting, so `onEditorContentChanged` stopped firing. The previous monitor tolerated the missing interval by accident, polling on a 0ms timer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A55JP8ZvqUAq4yct9nzckD
dcalhoun
force-pushed
the
fix/autosave-monitor-interval
branch
from
September 29, 2026 16:24
14c7b71 to
989b3fa
Compare
dcalhoun
marked this pull request as ready for review
September 29, 2026 17:14
crazytonyli
approved these changes
Sep 30, 2026
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.
What?
Fix content change bridge communication events that were never firing after #691.
Why?
The missing events prevent hosts from capturing in-progress edits, which can lead to content loss in the event of a reload or crash.
How?
Explicitly set an
AutosaveMonitorinterval. Previously, a bug in the upstream Gutenberg core's component resulted in autosaves triggering by coincidence.Testing Instructions
Accessibility Testing Instructions
N/A, no user-facing changes.
Screenshots or screencast
N/A, no user-facing changes.
AI-generated details
Why:
onEditorContentChangedstopped firing after #691.@wordpress/editor15 rewroteAutosaveMonitor, which now skips its checks when no interval is set. GBK never passed one, and hosts never provide theautosaveIntervaleditor setting (wp-admin sets it from PHP'sAUTOSAVE_INTERVAL). The previous monitor tolerated the missing interval by accident:setTimeout( fn, NaN )polled on a 0ms timer.How: Pass
interval={ 1 }toAutosaveMonitor. A new E2E test stubswindow.editorDelegateand asserts the host is notified after an edit.Testing: With the demo changes from the previous PR in the stack, open an existing post via "Browse" and edit it. Save enables within about a second.
Known issues (not addressed here):
@wordpress/core-data8 clears edits matching that record on undo (Core Data: Cleanup edits matching persisted record on undo/redo WordPress/gutenberg#77100).AutosaveMonitorskips clean posts. After a host save, this also leaves dirty-state controls disabled (e.g., WordPress-iOS "Update").AutosaveMonitorrequiresisEditedPostSaveable. Dates back to fix: Improve autosave and unsaved changes detection #104.autosavesupport never notify the host. WordPress core adds it for any post type supportingeditor. Dates back to fix: Improve autosave and unsaved changes detection #104.🤖 Generated with Claude Code
https://claude.ai/code/session_01A55JP8ZvqUAq4yct9nzckD