Fix Reader TransactionTooLargeException by skipping WebView saved state#22969
Merged
Conversation
…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>
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
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.


Description
This PR fixes a long-standing
TransactionTooLargeExceptionwhenReaderPostPagerActivityis 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
ReaderWebViewin 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:
ReaderPostDetailFragmentalways re-renders the post from local data viaReaderPostRenderer(showPostInWebView), including after recreation.ReaderWebViewUrlClickListener.The fix simply sets
android:saveEnabled="false"onreader_webview, removing ~94% of the parcel with no behavior change.Testing instructions
Reader post detail still renders and restores correctly: