Skip to content

Fix Reader TransactionTooLargeException by skipping WebView saved state#22969

Merged
nbradbury merged 3 commits into
trunkfrom
fix/sentry-pcc-transaction-too-large
Jun 11, 2026
Merged

Fix Reader TransactionTooLargeException by skipping WebView saved state#22969
nbradbury merged 3 commits into
trunkfrom
fix/sentry-pcc-transaction-too-large

Conversation

@nbradbury

@nbradbury nbradbury commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes a long-standing TransactionTooLargeException when ReaderPostPagerActivity is stopped, resolving JETPACK-ANDROID-PCC (71 users / 9,500+ events since April 2024).

The crash event's bundle stats show a single view carrying 1.8 MB of the 1.9 MB saved-state parcel — the ReaderWebView in the post detail fragment. Android caps the Binder transaction that delivers saved instance state at ~1 MB, so the oversized parcel kills the app.

That saved state is never actually used:

  • ReaderPostDetailFragment always re-renders the post from local data via ReaderPostRenderer (showPostInWebView), including after recreation.
  • The WebView never navigates internally — link clicks are routed externally through ReaderWebViewUrlClickListener.

The fix simply sets android:saveEnabled="false" on reader_webview, removing ~94% of the parcel with no behavior change.

Testing instructions

Reader post detail still renders and restores correctly:

  1. Open the Reader and tap a post to open the post detail screen
  2. Swipe between a few posts in the pager
  • Verify each post renders its content normally
  1. Rotate the device (or toggle dark mode) to force an activity recreation
  • Verify the post content re-renders correctly after recreation
  1. Background the app, then return to it
  • Verify the post detail screen is restored without a crash

…oid TransactionTooLargeException

The ReaderWebView's framework-saved view state serializes the page
back/forward history and reached 1.8 MB of the 1.9 MB saved-state
parcel in ReaderPostPagerActivity, exceeding the ~1 MB Binder
transaction limit when the activity is stopped. The post is always
re-rendered from local data by ReaderPostRenderer and the WebView
never navigates internally, so the saved state is never used.
Disable it with android:saveEnabled="false".

Fixes JETPACK-ANDROID-PCC

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dangermattic

dangermattic commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22969-b8256cc
Build Number1493
Application IDcom.jetpack.android.prealpha
Commitb8256cc
Installation URL1h10hfa12esa0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22969-b8256cc
Build Number1493
Application IDorg.wordpress.android.prealpha
Commitb8256cc
Installation URL2t37ilt8ucdh0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@nbradbury nbradbury marked this pull request as ready for review June 10, 2026 19:47
@nbradbury nbradbury requested a review from adalpari June 10, 2026 19:47

@adalpari adalpari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice fix! 🚢 it!

@nbradbury nbradbury enabled auto-merge (squash) June 11, 2026 10:55
@nbradbury nbradbury merged commit ed74f71 into trunk Jun 11, 2026
19 of 22 checks passed
@nbradbury nbradbury deleted the fix/sentry-pcc-transaction-too-large branch June 11, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants