Skip to content

[No QA] Strict API: bump react-native-safe-area-context to >= 5.8.1 - #101820

Closed
roryabraham wants to merge 3 commits into
mainfrom
rory/strict-api-safe-area
Closed

roryabraham wants to merge 3 commits into
mainfrom
rory/strict-api-safe-area

Conversation

@roryabraham

@roryabraham roryabraham commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

react-native-safe-area-context 5.6.2 type-checks as part of this project. Under the Strict API its Jest mock imports react-native/Libraries/... subpaths that no longer resolve (TS2307). That was fixed in 5.8.1 by moving the mock into the package build: appandflow/react-native-safe-area-context#745

5.10.0 is the latest 5.x, but it was published 2026-09-16 and .npmrc min-release-age=7 rejects it. 5.9.1 (2026-08-18) is the newest installable 5.x and is >= 5.8.1. No other dependency versions moved.

Also dropped patches/react-native-safe-area-context. The 5.6.2 removeChild patch landed upstream in 5.9.0 (appandflow/react-native-safe-area-context#746), so leaving it would fail patch-package. ios/Podfile.lock version pins were updated to match; the podspec itself is unchanged aside from the version it reads from package.json.

Fixed Issues

$ #101818

Tests

None. Looking at the diff, there are almost no runtime changes, with the only significant runtime change being appandflow/react-native-safe-area-context#730, which only affects old arch.

  • Verify that no errors appear in the JS console

Offline tests

n/a

QA Steps

None.

  • 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
    • MacOS: Desktop
  • 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
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

5.8.1 moves the Jest mock into the package build so it no longer imports
react-native/Libraries subpaths that fail under the Strict API. 5.10.0 is
the latest 5.x but is blocked by min-release-age. Drop the 5.6.2 removeChild
patch, which landed upstream in 5.9.0.
The podspec is unchanged aside from the version it reads from package.json,
so only the version pins move.
@roryabraham

Copy link
Copy Markdown
Contributor Author

@codex review

@roryabraham

Copy link
Copy Markdown
Contributor Author

@MelvinBot review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c72aad2ef3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ios/Podfile.lock
- ReactNativeDependencies
- Yoga
- react-native-safe-area-context (5.6.2):
- react-native-safe-area-context (5.9.1):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Regenerate the safe-area pod checksum

The pod versions are manually advanced to 5.9.1, but the SPEC CHECKSUMS entry at line 4055 remains the checksum from 5.6.2. Because the podspec reads its version from the package metadata, CocoaPods computes a different checksum for 5.9.1; running the standalone npm run pod-install will therefore rewrite Podfile.lock instead of reproducing the committed lockfile. Regenerate the lock with CocoaPods and commit the resulting checksum.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 1b7bf37. SPEC CHECKSUMS now reads 6acf61f42ee0862bbe00ed7e6c11cd0b81b7f6e3, the SHA1 of the generated local podspec JSON for 5.9.1 (same value HybridApp's lockfile gets for this version).

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Reviewed the bump. One thing to fix, everything else holds up.

The SPEC CHECKSUMS entry in ios/Podfile.lock is stale. ios/Podfile.lock:4055 still reads react-native-safe-area-context: 4b3960e27c8a3ca0c1523348f97513e27f8509b7 while the PODS entries moved to 5.9.1. For a :path pod, CocoaPods checksums the generated ios/Pods/Local Podspecs/<pod>.podspec.json — which embeds the resolved version — not the Ruby podspec, so that line has to change on a version bump even though the podspec file itself didn't. Run npm run pod-install on a Mac and commit the regenerated lockfile rather than editing the version strings by hand. Nothing in CI catches this (verifyPodfilePrebuilt.yml only checks that react-native resolved from prebuilt artifacts), but the next person's pod install will rewrite the lockfile under them.

Why I'm confident the checksum must change
  • No path pod's lockfile checksum is the SHA1 of its Ruby podspec: sha1(node_modules/react-native-safe-area-context/react-native-safe-area-context.podspec) = 2bfce6ed…, lockfile says 4b3960e2…. Same mismatch for RNScreens and RNSVG. The checksummed file is the JSON copy, and scripts/pod-install.sh:93-98 confirms that JSON carries .version.
  • Every past bump of this pod changed it — 4.12.0 → 5.4.0 moved b3edb1da… → 9b169299… in 2d2303f37b. Same pattern for other node_modules pods (NitroModules in 62b2506, react-native-airship in 2b74c87).

Verified the rest of the reasoning in the description:

  • Dropping the patch is correct. 5.9.1 ships the fix in both the module and commonjs builds: the transition listener comes off first, then element.remove().
  • Version choice checks out. 5.10.0 was published 2026-09-16 (5 days ago, so min-release-age=7 rejects it) and 5.9.1 on 2026-08-18, making it the newest installable release >= 5.8.1.
  • The package-lock.json diff is complete — 5.6.2 and 5.9.1 declare identical dependencies and peer dependencies, so nothing else in the tree moves.
  • The podspec file is byte-identical between the two versions (md5 6a6d6897… both), so the PODS/DEPENDENCIES sections legitimately only shift version strings.
  • Nothing left behind referencing the deleted patch, and App's own __mocks__/react-native-safe-area-context.tsx means the upstream Jest mock path isn't on App's test path either way.
  • Android side looks safe: 5.9.0 adopted AGP 9 but gates it behind an AGP-major fallback, and 5.9.1 re-registers src/paper/java for old architecture. App is new architecture on Gradle 9.3.1. The Android and iOS build checks were still pending when I looked.

Worth an explicit QA pass on web. 5.9.0 also rewrote the web provider: insets are now clamped to the provider view's bounding rect, frame comes from that rect instead of document.documentElement, and updates now fire on window resize and through a ResizeObserver. App's root provider in src/App.tsx:91 is full-viewport and useSafeAreaFrame is only used on native, so values shouldn't move — but iOS Safari and the installed PWA are where env(safe-area-inset-*) is non-zero, so that's the case to eyeball.

One caveat on scope: I reviewed this statically and did not run the app, because this environment can't install the bumped dependency — a web run here would have exercised 5.6.2 plus the old patch, not 5.9.1. Also worth confirming whether HybridApp's own iOS lockfile pins this pod and needs a matching bump; I couldn't check that from here.

@roryabraham roryabraham changed the title Strict API: bump react-native-safe-area-context to >= 5.8.1 [No QA] Strict API: bump react-native-safe-area-context to >= 5.8.1 Sep 21, 2026
CocoaPods checksums the generated local podspec JSON, which embeds the
version, so the SPEC CHECKSUMS entry has to move with the version pins.
@roryabraham

Copy link
Copy Markdown
Contributor Author

Addressed the stale SPEC CHECKSUMS entry in 1b7bf37. react-native-safe-area-context is now 6acf61f42ee0862bbe00ed7e6c11cd0b81b7f6e3, the SHA1 of the generated Local Podspecs JSON for 5.9.1. That JSON is identical to the 5.6.2 one except for the version and source tag, which is the only field that changes when the podspec itself is unchanged.

No Mobile-Expensify companion PR is needed for this bump. HybridApp's lockfile pins the same path pod, and Expensify/Mobile-Expensify#14138 already moves its version pins and checksum to the same values (linked from #101446).

@roryabraham

Copy link
Copy Markdown
Contributor Author

Closing as a dupe

@roryabraham
roryabraham deleted the rory/strict-api-safe-area branch September 22, 2026 04:27
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.

2 participants