Skip to content

Conversation

@dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Jan 16, 2026

Description

Ref CMM-1123.

Implements the editorRequestsLatestContent delegate method for GutenbergKit's pull-based content recovery mechanism.

When the WebView reinitializes (due to OS memory pressure or page refresh), the editor now requests the latest content from the app rather than using stale content from the initial WebView load. This ensures users don't lose their work during WebView recovery.

Changes:

  • Added editorRequestsLatestContent(_:) delegate method to NewGutenbergViewController
  • Returns the current post title and content from Core Data (the authoritative source updated via autosave)
  • Properly set overlooked post status and ID to avoid unexpectedly emptying post titles.

Related PRs:

Testing instructions

  1. Open a post with existing content in the GutenbergKit editor
  2. Make edits to the content (wait 2+ seconds for autosave to persist)
  3. Trigger a WebView refresh:
    • Safari DevTools: Cmd+R while WebView is inspected via the Safari Inspector
    • iOS Simulator: Open Activity Monitor, force quit "com.apple.WebKit.WebContent"
  4. Verify the editor recovers with the edited content, not the original

🤖 Generated with Claude Code

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 16, 2026

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 16, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number30570
VersionPR #25144
Bundle IDorg.wordpress.alpha
Commit65cd331
Installation URL3tan0sjj3vafg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 16, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number30570
VersionPR #25144
Bundle IDcom.jetpack.alpha
Commit65cd331
Installation URL063rgv751b3e8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@dcalhoun dcalhoun added [Type] Enhancement Posting/Editing Gutenberg Editing and display of Gutenberg blocks. labels Jan 16, 2026
@dcalhoun dcalhoun marked this pull request as draft January 19, 2026 14:55
@dangermattic
Copy link
Collaborator

dangermattic commented Jan 20, 2026

1 Warning
⚠️ This PR is assigned to the milestone 26.6. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@dcalhoun

This comment was marked as outdated.

@dcalhoun dcalhoun force-pushed the feat/gutenberg-kit-pulls-content branch from e38178f to 4499f07 Compare January 21, 2026 15:26
@dcalhoun dcalhoun marked this pull request as ready for review January 21, 2026 17:29
@dcalhoun dcalhoun requested a review from kean January 21, 2026 17:56
Base automatically changed from feat/preload-gutenberg-kit-dependencies to trunk January 21, 2026 21:44
@dcalhoun dcalhoun force-pushed the feat/gutenberg-kit-pulls-content branch from 024776c to 749be13 Compare January 22, 2026 16:56
@dcalhoun dcalhoun added this to the 26.6 milestone Jan 22, 2026
Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

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

I followed the testing instructions and it worked for me!

@dcalhoun dcalhoun enabled auto-merge January 22, 2026 21:33
@dcalhoun dcalhoun added this pull request to the merge queue Jan 22, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jan 22, 2026
@dcalhoun dcalhoun force-pushed the feat/gutenberg-kit-pulls-content branch from a96a4f4 to 2a6ddba Compare January 22, 2026 21:56
@dcalhoun dcalhoun enabled auto-merge January 22, 2026 21:56
@dcalhoun dcalhoun added this pull request to the merge queue Jan 22, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jan 22, 2026
Allow GutenbergKit to retrieve the latest content persisted in the host
app as needed. This is important for allowing GutenbergKit to display
the latest content after the WebView reloads or re-initializes from
memory pressure or backgrounding.
@dcalhoun dcalhoun force-pushed the feat/gutenberg-kit-pulls-content branch from 2a6ddba to 65cd331 Compare January 22, 2026 23:05
@dcalhoun dcalhoun enabled auto-merge January 22, 2026 23:05
@sonarqubecloud
Copy link

@dcalhoun dcalhoun added this pull request to the merge queue Jan 22, 2026
Merged via the queue into trunk with commit b10a516 Jan 22, 2026
29 of 35 checks passed
@dcalhoun dcalhoun deleted the feat/gutenberg-kit-pulls-content branch January 22, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gutenberg Editing and display of Gutenberg blocks. Posting/Editing [Type] Enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants