Skip to content

[No QA] Add react-native-quick-crypto dependency - #97673

Merged
roryabraham merged 5 commits into
Expensify:mainfrom
software-mansion-labs:korytko/add-react-native-quick-crypto
Aug 3, 2026
Merged

[No QA] Add react-native-quick-crypto dependency#97673
roryabraham merged 5 commits into
Expensify:mainfrom
software-mansion-labs:korytko/add-react-native-quick-crypto

Conversation

@JakubKorytko

@JakubKorytko JakubKorytko commented Aug 3, 2026

Copy link
Copy Markdown
Member

Explanation of Change

Adds react-native-quick-crypto (plus its react-native-quick-base64 native runtime dependency) and updates the iOS Podfile.lock (App and Mobile-Expensify) via npm run pod-install / npm run pod-install-standalone. Issue #96631 originally proposed expo-crypto, but @roryabraham commented on Slack that react-native-quick-crypto is the better choice: it's Nitro-based (better performance), avoids further Expo lock-in, implements the full Node.js crypto spec (easier to swap out later), we have a closer relationship with Margelo than Expo, and it's Claude's first suggestion for the de-facto standard. This was further endorsed with 10 likes on a related Slack thread.

Fixed Issues

$ #96631
PROPOSAL: N/A
Mobile-Expensify PR: https://github.com/Expensify/Mobile-Expensify/pull/14043

Tests

  1. Pull this branch alongside the corresponding Mobile-Expensify branch korytko/add-react-native-quick-crypto
  2. Run npm install and npm run pod-install
  3. Build the app for iOS (npm run ios)
  4. Verify that the app builds successfully with no errors related to react-native-quick-crypto, react-native-quick-base64, or CocoaPods
  5. Repeat step 2-4 for standalone

Offline tests

N/A

QA Steps

N/A

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 followed proper code patterns (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 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)
  • 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.
  • 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

@github-actions

github-actions Bot commented Aug 3, 2026

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. ⚠️

@JakubKorytko

Copy link
Copy Markdown
Member Author

@codex 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: de1a7894f7

ℹ️ 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 package.json
@JakubKorytko

Copy link
Copy Markdown
Member Author

@codex 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: 80a23f6bcc

ℹ️ 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 package.json
@JakubKorytko

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 655dcdc4d9

ℹ️ 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".

@JakubKorytko
JakubKorytko marked this pull request as ready for review August 3, 2026 10:41
@JakubKorytko
JakubKorytko requested a review from a team as a code owner August 3, 2026 10:41
@melvin-bot
melvin-bot Bot requested review from marufsharifi and removed request for a team August 3, 2026 10:41
@melvin-bot

melvin-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

@marufsharifi 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]

@marufsharifi

marufsharifi commented Aug 3, 2026

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

Comment thread package.json
"react-native-plaid-link-sdk": "12.5.3",
"react-native-qrcode-svg": "6.3.21",
"react-native-quick-base64": "^3.0.1",
"react-native-quick-crypto": "^1.1.6",

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.

Pin these native modules to exact versions (drop the ^).

"react-native-quick-base64": "^3.0.1",
"react-native-quick-crypto": "^1.1.6",

Every other Nitro-based native module in this repo is pinned exactly:

react-native-nitro-modules": "0.36.3"
react-native-nitro-fetch":   "1.5.4"
react-native-nitro-sqlite":  "9.6.0"

quick-crypto is a Nitro module compiled against a specific NitroModules ABI and OpenSSL-Universal (~> 3.6.2000), and its exact resolutions are frozen in the committed Podfile.lock (QuickCrypto: 1.1.6, react-native-quick-base64: 3.0.1). With a caret range a future npm install can resolve 1.2.x/3.x, diverging from the committed checksums and causing a JS-vs-native mismatch / hard-to-diagnose native link failure. Suggest:

"react-native-quick-base64": "3.0.1",
"react-native-quick-crypto": "1.1.6",

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.

@JakubKorytko are you doing this? I am not sure if it's really needed, I see no value in using exact versions, given the lockflie exists anyway.

Comment thread ios/Podfile.lock
AppAuth: d4f13a8fe0baf391b2108511793e4b479691fb73
AppLogs: 3bc4e9b141dbf265b9464409caaa40416a9ee0e0
boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90
boost: 659a89341ea4ab3df8259733813b52f26d8be9a5

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.

Please confirm the unrelated Podfile.lock churn is an intentional clean regen.

Beyond the expected OpenSSL-Universal / QuickCrypto / react-native-quick-base64 additions, this lock also bumps checksums unrelated to crypto:

- boost: 7e761d76…          + boost: 659a8934…
- hermes-engine: b9fce683…  + hermes-engine: 9411dff0…
- React-Core: 821522bb…     + React-Core: 4b12e886…
- React-perflogger: 69b12c…  + React-perflogger: 5bfe39e…

…and adds React-rendererconsistency to ~14 turbomodule specs. Adding a crypto pod doesn't produce these. It suggests the lock was regenerated against node_modules podspecs that differ from main. If it wasn't a clean "merge main + re-pod," CI's pod install can resolve different checksums than committed → spurious lockfile-dirty failures. Can you confirm main was merged and these 5 checksum changes are expected?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, this is intended clean-up. I could scrap the unrelated changes but then on each pod-install they would appear as not staged.

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.

How did this happen that the lockflie is out of date?

Comment thread package.json
"react-native-plaid-link-sdk": "12.5.3",
"react-native-qrcode-svg": "6.3.21",
"react-native-quick-base64": "^3.0.1",
"react-native-quick-crypto": "^1.1.6",

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.

NAB: web has no native crypto.**

react-native-quick-crypto is iOS/Android-native only, but this App also ships web (react-native-web). Nothing imports the library in this diff, so there's no breakage today. But the follow-up that actually uses it must guard web with a platform-specific impl (.web.ts split / Platform check / JS crypto fallback), or the web bundle will fail to resolve the Nitro native module at import time. Flagging now so it isn't missed downstream.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, thanks for bringing that up, we are aware and it is noted in design doc.

@marufsharifi

Copy link
Copy Markdown
Contributor

@MelvinBot Review

@MelvinBot

Copy link
Copy Markdown
Contributor

Review

Clean, correctly-scoped foundational dependency addreact-native-quick-crypto + its react-native-quick-base64 runtime dep, with the matching iOS pods and knip.json ignore entries. Nothing is imported in JS yet, which is why the two packages are (correctly) added to knip's ignore list rather than showing up as unused. A web smoke test on a signed-in build loads and renders normally — no bundling/console regression from the package.json/lockfile change (expected, since neither package is pulled into the web bundle).

No blockers. Two things worth a second look before merge:

1. The ios/Podfile.lock regeneration pulled in changes unrelated to crypto. Beyond the expected QuickCrypto / react-native-quick-base64 / OpenSSL-Universal additions, the lock also:

  • adds React-rendererconsistency as a dependency under ~14 RN pods (new + lines vs main), and
  • re-hashes boost, hermes-engine, React-Core, React-perflogger, and React-rendererconsistency.

Those aren't caused by adding a crypto library — they look like the lock picking up React Native drift from a node_modules state that's ahead of/behind main. hermes-engine/React-Core checksums shifting can just be local-build noise, but adding React-rendererconsistency to other pods' dependency lists is a structural change. Please confirm the branch was regenerated on top of the latest main so an unintended RN pod movement doesn't ride along in this PR.

2. Version pinning uses caret ranges (^3.0.1 / ^1.1.6). Caret is used elsewhere in the file, so this isn't a rule violation — but the adjacent react-native-* entries are exact-pinned, and for native modules that feed the Podfile.lock, exact pins keep the native build reproducible. Optional, but consider matching the neighbors.

Notes I checked and think are fine
  • react-native-quick-base64 as a direct dependency — quick-crypto pulls it in transitively (via @craftzdog/react-native-buffer); listing it explicitly matches quick-crypto's install docs so it autolinks. Correct.
  • is-arguments losing "dev": true in package-lock.json — expected transitive promotion, just lockfile bookkeeping.
  • Android — App commits no Android native lock; autolinking handles the new module at Gradle build time, and the standalone/hybrid side is the linked Mobile-Expensify PR. I can't compile the Android build from here, so that path rests on the author's checklist + the paired PR.
  • No JS consumer yet — intentional per issue [Due for payment 2026-08-11] Add expo-crypto for PKCE in Cloudflare Zero Trust QA OAuth flow #96631; a follow-up is expected to actually use the crypto API.

Web smoke test — signed-in Home renders normally

Signed-in NewDot web Home screen rendering normally after adding the dependency

@melvin-bot
melvin-bot Bot requested a review from luacmartins August 3, 2026 15:57

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

Merging since the Mobile-Expensify PR is merged already

@roryabraham
roryabraham merged commit 10c0f1f into Expensify:main Aug 3, 2026
49 of 50 checks passed
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify

OSBotify commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/roryabraham in version: 9.4.49-0 🚀

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

@OSBotify

OSBotify commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/arosiclair in version: 9.4.49-3 🚀

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

Bundle Size Analysis (Sentry):

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.

7 participants