Skip to content

[CP Stg] Patch RN 0.86 to fix Fabric reusing nodes with a stale font scale - #98507

Merged
mountiny merged 6 commits into
mainfrom
rory/rn-patch-stale-font-scale
Aug 13, 2026
Merged

[CP Stg] Patch RN 0.86 to fix Fabric reusing nodes with a stale font scale#98507
mountiny merged 6 commits into
mainfrom
rory/rn-patch-stale-font-scale

Conversation

@roryabraham

@roryabraham roryabraham commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Backports upstream React Native commit 45904c8Fix Fabric reusing nodes with a stale font scale as a patch for RN 0.86.0.

Fixed Issues

$ #98499

Tests

Retest the linked issue.

  • Verify that no errors appear in the JS console

Offline tests

n/a

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

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 (i.e. verify an input displays the correct error message if the entered data is not correct)
    • 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)
    • 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).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • 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)
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • 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.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • 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.
  • 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)
  • 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.
  • 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.
  • 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:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • 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.

Screenshots/Videos

Android: Native
Android: mWeb Chrome

N/A — native-only change, mWeb is unaffected.

iOS: Native
iOS: mWeb Safari

N/A — native-only change, mWeb is unaffected.

MacOS: Chrome / Safari

N/A — native-only change, web is unaffected.

@github-actions

Copy link
Copy Markdown
Contributor

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

NicolasBonet
NicolasBonet previously approved these changes Aug 12, 2026
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

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

@mkhutornyi

Copy link
Copy Markdown
Contributor

This fixes the linked issue:

Screen.Recording.2026-08-13.at.12.13.26.AM.mov

main/staging:

Screen.Recording.2026-08-13.at.12.14.32.AM.mov

@github-actions

This comment has been minimized.

@roryabraham

Copy link
Copy Markdown
Contributor Author

Requested Applause retest to be safe: https://expensify.slack.com/archives/C09V78U42D8/p1786577103176859

@roryabraham roryabraham changed the title Patch RN 0.86 to fix Fabric reusing nodes with a stale font scale [CP Stg] Patch RN 0.86 to fix Fabric reusing nodes with a stale font scale Aug 12, 2026
@roryabraham

roryabraham commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

We have conflicting reports whether this will fix the linked issue:

I'm wondering if the AdHoc build actually picked up the patch - I'm not confident that the prebuilt artifact code is smart enough to notice a new RN patch in an AdHoc build and compile RN from source.

So, given that this is a patch from the upstream that we know we can drop with the 0.87 upgrade and presumably fixed some known bugs upstream, I suggest we merge and CP it then retest on staging.

@roryabraham
roryabraham requested a review from mountiny August 13, 2026 01:05
@roryabraham
roryabraham marked this pull request as ready for review August 13, 2026 01:05
@roryabraham
roryabraham requested a review from a team as a code owner August 13, 2026 01:05
@melvin-bot
melvin-bot Bot requested review from NicolasBonet and suneox and removed request for a team August 13, 2026 01:05
@melvin-bot

melvin-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

@suneox @NicolasBonet One of you needs to 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]

@roryabraham

roryabraham commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author
Claude says the AdHoc build DID include the patch

The AdHoc build did include the native patch — so that doesn't explain the conflicting reports

There were conflicting reports about whether this fixed the linked issue, and one theory was that the AdHoc build might have used precompiled React Native artifacts and therefore not contained the native patch at all. I checked the logs for AdHoc build run 31649688731 and that is not what happened — the patch is genuinely compiled into both the iOS and Android binaries.

Evidence

1. Both jobs checked out the right commit

Both build jobs report HEAD is now at 52206fb Declare fontSizeMultiplier last to keep @rnmapbox/maps positional init valid — the final commit, not one of the earlier broken revisions of this patch.

The build fingerprint recorded patch 037 with sha1 38723595a27ac0e3348d921ea86e0d4e358c0b0c, which matches shasum -a 1 of the patch file on this branch exactly.

2. patch-package applied it on both platforms

react-native@0.86.0 (37 fix-stale-font-scale) ✔
🎉 patch-package succeeded without errors or warnings

3. iOS built React Native from source, including the patched files

[ReactNativeDependencies] No prebuilt artifacts found, reverting to building from source.
[ReactNativeDependencies] Building from source: true

and, decisively, clang compiled the two patched .cpp files into the React-Fabric pod (iOS job):

CompileC .../React-Fabric.build/Objects-normal/arm64/YogaLayoutableShadowNode.o
  .../node_modules/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp
CompileC .../React-Fabric.build/Objects-normal/arm64/SurfaceHandler.o
  .../node_modules/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp

Those compile at 23:14:03, well after patch-package ran at 23:09:37.

4. Android built React Native from source too

> Task :react-native:packages:react-native:ReactAndroid:buildCMakeRelWithDebInfo[arm64-v8a][hermestooling,jsi,etc]
> Task :react-native:packages:react-native:ReactAndroid:buildCMakeRelWithDebInfo[x86_64][hermestooling,jsi,etc]

producing node_modules/react-native/ReactAndroid/build/intermediates/cxx/RelWithDebInfo/.../libreactnative.so — compiled from the patched tree (Android job). There are zero references to a prebuilt Maven react-android AAR anywhere in the log.

Rock's remote cache was a miss (No artifact found), so it built from scratch and then uploaded the result — it did not restore a stale prebuilt binary. Worth noting that a stale hit isn't really possible here anyway, since Rock's fingerprint includes the hash of every file in patches/, so changing this patch necessarily changes the cache key.

5. The feature flag is on

The patched code path is gated behind RN's enableFontScaleChangesUpdatingLayout, which defaults to true in 0.86.0. I found no override of it in App or in Mobile-Expensify, so it keeps that default.

So why the conflicting reports?

Since the fix is definitely in the binary, the difference has to come from somewhere else. Ranked by what I think is most likely:

  1. Test methodology. This bug is specifically about stale nodes being reused. Changing the OS font size and then cold-launching the app rebuilds the shadow tree from scratch and will look correct with or without the patch. The fix only demonstrates itself when the font size changes while the app is already running with a populated tree (background → change font size → foreground). Two testers doing this differently would genuinely see different results, with neither making a mistake.
  2. It may be a partial fix. The re-measure only applies to nodes carrying the MeasurableYogaNode trait. Any text whose layout doesn't go through that path would still go stale, which would show up as "some screens fixed, others not."
  3. Platform split. Worth knowing which platform each report came from.
  4. Wrong build installed. The AdHoc comment links several builds. Both artifacts from this run are keyed 52206fb-d5c25ee, so it's worth confirming that's what the "didn't fix it" tester actually installed.

To narrow it down, the most useful things to know are: which platform each report came from, and whether the tester who saw no fix changed the font size with the app already running or cold-launched it afterwards.


🤖 Generated with Claude Code

@mountiny

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • 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)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • 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.
    • 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)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • 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.
  • 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)
  • 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.
  • 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.
  • 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:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari

@mountiny mountiny 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.

@mkhutornyi Tested, seems like this is a safe thing to try

@mountiny
mountiny merged commit 14bdb5f into main Aug 13, 2026
39 of 41 checks passed
@mountiny
mountiny deleted the rory/rn-patch-stale-font-scale branch August 13, 2026 08:00
@github-actions

Copy link
Copy Markdown
Contributor

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

OSBotify pushed a commit that referenced this pull request Aug 13, 2026
[CP Stg] Patch RN 0.86 to fix Fabric reusing nodes with a stale font scale

(cherry picked from commit 14bdb5f)

(cherry-picked to staging by mountiny)
@OSBotify OSBotify added the CP Staging marks PRs that have been CP'd to staging label Aug 13, 2026
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #98507.

Android 🤖 iOS 🍎
❌ FAILED ❌ https://ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com/rock-artifacts/ad-hoc/rock-ios-device-AdHoc-14bdb5f-2877304-108465555d749c1c79a5b6d2f757d031a0802a9a/index.html
The QR code can't be generated, because the Android build failed iOS
Web 🕸️
https://98507.pr-testing.expensify.com
Web

👀 View the workflow run that generated this build 👀

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.4.53-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 failure ❌
🍎 iOS 🍎 success ✅

@OSBotify

Copy link
Copy Markdown
Contributor

🔁 Filed a Staging retest request for deploy blockers #98499 after this PR was cherry-picked to staging.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.4.53-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

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

Labels

CP Staging marks PRs that have been CP'd to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants