Skip to content

Fix Reader TransactionTooLargeException by skipping WebView saved state#22969

Open
nbradbury wants to merge 1 commit into
trunkfrom
fix/sentry-pcc-transaction-too-large
Open

Fix Reader TransactionTooLargeException by skipping WebView saved state#22969
nbradbury wants to merge 1 commit 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

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-cbdf291
Build Number1493
Application IDcom.jetpack.android.prealpha
Commitcbdf291
Installation URL7idjpsblrtv00
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

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-cbdf291
Build Number1493
Application IDorg.wordpress.android.prealpha
Commitcbdf291
Installation URL57kuk3s2sle30
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
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.

3 participants