Skip to content

Backport missing ViewState guards for state and padding updates - #98869

Open
KJ21-ENG wants to merge 1 commit into
Expensify:mainfrom
KJ21-ENG:KJ21-ENG/93833-viewstate-state-padding-follow-up
Open

Backport missing ViewState guards for state and padding updates#98869
KJ21-ENG wants to merge 1 commit into
Expensify:mainfrom
KJ21-ENG:KJ21-ENG/93833-viewstate-state-padding-follow-up

Conversation

@KJ21-ENG

@KJ21-ENG KJ21-ENG commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Extends the existing React Native 0.86 patch for missing Android Fabric
ViewState values. The patch already guards updateOverflowInset; this follow-up
backports React Native commit 0e86a043 so updatePadding and updateState also
use getNullableViewState(), soft-log a missing state, and return instead of
throwing RetryableMountingLayerException from a non-retryable
IntBufferBatchMountItem.

This addresses the production 9.4.46-10 fatal recurrence whose stack is
getViewState -> updateState -> IntBufferBatchMountItem. Search/FlashList
clipping, sendAccessibilityEvent, and setJSResponder are intentionally
unchanged.

Fixed Issues

$ #93833
PROPOSAL: #93833 (comment)

Tests

The production crash is nondeterministic, so these steps provide regression
smoke coverage rather than deterministic proof of the fix.

  1. Sign in to the Android HybridApp with an account containing many reports and expenses.
  2. Open Search and open reports from the search results.
  3. Navigate repeatedly between Search and report views.
  4. Scroll quickly through long lists and repeatedly expand and collapse grouped report rows.
  5. Verify the app remains responsive and does not crash.

Final effectiveness will be confirmed by monitoring APP-3E3 after deployment.

  • Verify that no errors appear in the JS console — N/A: this changes Kotlin
    inside React Native and introduces no JS/TS execution path.

Offline tests

N/A. The guard runs in React Native's Android Fabric mounting layer and does not
depend on network, Onyx, account, or permission state.

QA Steps

Same as Tests. Treat this as regression smoke coverage only; monitor APP-3E3
after deployment to confirm effectiveness.

  • Verify that no errors appear in the JS console — N/A: Android native-only change.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios. N/A: the missing native ViewState is the failure path handled by the guard; there is no input or user-facing error state.
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior. N/A: network state cannot reach this Fabric guard, and no offline manual run is claimed.
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions. N/A: no account or API behavior changes, and no high-traffic manual run is claimed.
  • I included screenshots or videos for tests on all platforms. N/A: there is no visual change.
  • I ran the tests on all platforms & verified they passed on. N/A: this is an Android-only React Native Kotlin patch; cross-platform manual testing is not claimed.
    • Android: Native. N/A: the nondeterministic smoke flow was not performed; patch application and remote validation are the repeatable proof claimed by this draft.
    • Android: mWeb Chrome. N/A.
    • iOS: Native. N/A.
    • iOS: mWeb Safari. N/A.
    • MacOS: Chrome / Safari. N/A.
  • I verified there are no console errors. N/A: no JS/TS path changed, and no manual console run is claimed.
  • I followed proper code patterns
    • I verified that comments were added to code that is not self explanatory. N/A: no explanatory code comment is needed for the exact upstream guard.
    • I verified that any new or modified comments were clear, correct English, and explained why. N/A: no code comments changed.
    • I verified any copy/text added to the app is grammatically correct. N/A: no product copy changed; diagnostic strings match upstream.
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers. N/A: this is the established upstream missing-ViewState guard pattern.
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes. N/A: no App component changed; patch integrity covers the React Native backport.
  • If a new CSS style is added I verified that. N/A: no styles changed.
    • A similar style doesn't already exist. N/A.
    • The style can't be created with an existing StyleUtils function. N/A.
  • If new assets were added or existing ones were modified, I verified that. N/A: no assets changed.
    • The assets are optimized and compressed. N/A.
    • The assets load correctly across all supported platforms. N/A.
  • If the PR modifies code that runs when editing or sending messages, I tested supported markdown. N/A: message editing/sending is unchanged.
  • If the PR modifies a generic component, I tested its usages. N/A: no App component changed.
  • If the PR modifies a component related to Storybook stories, I verified those stories. N/A: no component changed.
  • If the PR modifies a component or page accessed by deeplink, I verified logged-in and logged-out behavior. N/A: no page or route changed.
  • If the PR modifies UI or form input styles, I verified alignment and requested Design review. N/A: no UI or form styles changed.
    • I verified all form inputs are aligned. N/A.
    • I added the Design label or tagged Expensify/design. N/A.
  • I added unit tests for any new feature or bug fix. N/A: App has no JS/TS test seam for this Kotlin React Native mount-layer patch; clean patch application and remote CI validate the backport.
  • If main was merged after review, I tested again. N/A: the branch starts from current upstream/main and no later merge has occurred.

Screenshots/Videos

Android: Native

N/A: no visual change.

Android: mWeb Chrome

N/A: Android native-only change.

iOS: Native

N/A: Android native-only change.

iOS: mWeb Safari

N/A: Android native-only change.

MacOS: Chrome / Safari

N/A: Android native-only change.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@KJ21-ENG
KJ21-ENG marked this pull request as ready for review August 18, 2026 13:47
@KJ21-ENG
KJ21-ENG requested a review from a team as a code owner August 18, 2026 13:47
@melvin-bot
melvin-bot Bot requested review from eVoloshchak and removed request for a team August 18, 2026 13:48
@melvin-bot

melvin-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

@eVoloshchak Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant