Skip to content

Backport missing ViewState guard for updateOverflowInset#97010

Open
KJ21-ENG wants to merge 1 commit into
Expensify:mainfrom
KJ21-ENG:KJ21-ENG/93833-overflow-inset-viewstate-guard
Open

Backport missing ViewState guard for updateOverflowInset#97010
KJ21-ENG wants to merge 1 commit into
Expensify:mainfrom
KJ21-ENG:KJ21-ENG/93833-overflow-inset-viewstate-guard

Conversation

@KJ21-ENG

@KJ21-ENG KJ21-ENG commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Backports React Native's missing-ViewState guard for
SurfaceMountingManager.updateOverflowInset() into the existing React Native 0.85.3
patch. A stale Fabric batch mount item can reference a view that has already been
removed; the patched method now soft-logs that condition and returns instead of
throwing RetryableMountingLayerException.

The existing addViewAt, updateProps, and updateLayout protections remain in
place. The combined patch can be removed when App upgrades to a React Native release
that contains all four upstream guards.

Fixed Issues

$ #93833
PROPOSAL: #93833 (comment)

Tests

The original production race has no known deterministic reproduction. The following
validation was performed:

  1. A clean remote dependency installation applied the combined React Native 0.85.3
    patch without warnings or errors.
  2. The upstream validate-patches check passed.
  3. Targeted format, ESLint, and React Compiler checks passed.
  4. git diff --check and a reverse-apply check against the installed patched React
    Native source passed.

Manual Android smoke is not claimed as deterministic proof; the repeatable smoke flow
is listed under QA Steps, and final effectiveness will be confirmed by monitoring
APP-3E3 after deployment.

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

Offline tests

N/A. The guard runs in React Native's Fabric mounting layer and does not read network,
Onyx, account, or permission state. No offline manual run is claimed.

QA Steps

The crash is not deterministically reproducible. Use these steps as regression smoke
coverage; production effectiveness will be confirmed by monitoring APP-3E3.

  1. Sign in to the Android HybridApp with an account containing many reports and expenses.
  2. Open the Search tab and open a report from the search results.
  3. Scroll quickly through the results and repeatedly expand and collapse grouped report rows.
  4. Verify the app remains responsive and does not crash.
  • Verify that no errors appear in the JS console

PR Author Checklist

Checked boxes below confirm that every current template item was reviewed. Items marked
N/A were not performed and are not claimed as test evidence. This is an Android-only
React Native Kotlin patch with no App UI, product copy, assets, CSS, message composer,
Storybook, deeplink, or JS/TS behavior change.

  • 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 (i.e. verify an input displays the correct error message if the entered data is not correct) — N/A: there is no input or user-facing error state; the missing native view is the failure path handled by the guard.
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline) — 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 (e.g. long loading states that impact usability). — 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 — automated patch/install validation passed; nondeterministic manual smoke remains for QA.
    • 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 (if there's a console error not related to the PR, report it or open an issue for it to be fixed) — N/A: no JS/TS path changed, and no manual console run is claimed.
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory — N/A: no explanatory code comment was needed for the exact upstream guard.
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing. — N/A: no code comments changed.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue) — N/A: no product copy changed; the diagnostic string matches upstream exactly.
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers — N/A: this uses the existing upstream missing-view-state guard pattern.
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected) — N/A: no App component changed.
  • If a new CSS style is added I verified that: — N/A.
    • A similar style doesn't already exist — N/A.
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)) — N/A.
  • If new assets were added or existing ones were modified, I verified that: — N/A.
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg) — 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 and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic. — N/A.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases) — N/A.
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected. — N/A.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account. — N/A.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles: — N/A.
    • I verified that all the inputs inside a form are aligned with each other. — N/A.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes. — N/A.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow. — N/A: there is no App JS/TS test seam for this Kotlin React Native patch; patch integrity and CI cover the backport.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps. — N/A: main has not been merged after review and the branch is still based on current main.

Screenshots/Videos

Android: Native

N/A — no visual change.

Android: mWeb Chrome

N/A — Android native-only change with no visual effect.

iOS: Native

N/A — Android native-only change with no visual effect.

iOS: mWeb Safari

N/A — Android native-only change with no visual effect.

MacOS: Chrome / Safari

N/A — Android native-only change with no visual effect.

@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 July 24, 2026 22:38
@KJ21-ENG
KJ21-ENG requested a review from a team as a code owner July 24, 2026 22:38
@melvin-bot
melvin-bot Bot requested a review from eVoloshchak July 24, 2026 22:38
@melvin-bot

melvin-bot Bot commented Jul 24, 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]

@github-actions

Copy link
Copy Markdown
Contributor

🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here.

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