Skip to content

fix: iOS startup crash from FOLLY_NO_CONFIG on RN 0.80+ - #4

Merged
jkasprzyk17 merged 3 commits into
mainfrom
fix/ios-folly-no-config-rn80
Sep 16, 2026
Merged

jkasprzyk17 merged 3 commits into
mainfrom
fix/ios-folly-no-config-rn80

Conversation

@jkasprzyk17

@jkasprzyk17 jkasprzyk17 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Stop defining FOLLY_NO_CONFIG in NitroPay.podspec when React Native ≥ 0.80, where it mismatches the generated folly-config.h and aborts at launch (folly dynamic.cpp Check failed: 0).
  • Keep the manual folly flags only for React Native < 0.80.
  • Fail hard during pod install if React Native cannot be resolved or its version cannot be parsed (no silent wrong-config fallback).
  • Document the crash and fix in the changelog and troubleshooting guide.

Test plan

  • cd package && bun run typecheck
  • cd package && bun run lint
  • cd example && bunx expo prebuild --clean && bunx expo run:ios (confirm app launches on RN 0.80+)
  • bun run docs:build

Risk

  • iOS-only; pods targeting RN < 0.80 still get the previous flags.
  • If RN version detection fails during pod install, the install aborts with an explicit error instead of guessing Folly flags.

Notes

  • Triggered by linking the library alone — no pay button required on screen.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 640eb515-ddc9-423b-9d94-fd802c3b43b9

📥 Commits

Reviewing files that changed from the base of the PR and between 88f2ab5 and 2825be4.

📒 Files selected for processing (1)
  • package/NitroPay.podspec

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • Fixed an iOS startup crash affecting React Native 0.80 and newer.
    • Improved compatibility with React Native’s folly configuration.
    • Added version-aware handling to prevent configuration mismatches across supported React Native versions.
  • Documentation

    • Added troubleshooting guidance for the crash, including upgrade and clean prebuild steps for older versions.
    • Documented the affected error messages and symptoms.

Walkthrough

NitroPay now resolves the installed React Native version with Open3, validates the metadata, and applies Folly flags only below version 0.80. The changelog and troubleshooting guide document the related iOS startup crash and remediation.

Changes

React Native Folly configuration

Layer / File(s) Summary
Version-gated Folly flags
package/NitroPay.podspec
The podspec validates React Native metadata and version parsing. It sets FOLLY_NO_CONFIG and FOLLY_CFG_NO_COROUTINES only for versions below 0.80.
Crash documentation
docs/docs/troubleshooting.md, CHANGELOG.md
The documentation describes the crash signature, cause, upgrade requirement, and clean Expo prebuild command.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 2825b

The podspec avoids shell interpolation, fails on invalid React Native metadata, and applies the Folly flags only for older supported versions; no concrete merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Check ✅ Passed No medium, high, or critical vulnerability is introduced. The only executable change uses Open3.capture3 with fixed arguments and passes Pod::Config.instance.installation_root through chdir, so …
Title check ✅ Passed The title clearly describes the iOS crash fix and uses the required fix: prefix. It is 55 characters, slightly above the preferred 50-character limit, but it remains concise and descriptive.
Description check ✅ Passed The description directly explains the React Native 0.80+ Folly configuration fix, validation plan, risk, and documentation updates.

Comment @coderabbitai help to get the list of available commands.

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package/NitroPay.podspec`:
- Around line 26-39: Update the react_native_below_80 detection block to raise a
CocoaPods error when resolving or reading React Native’s package metadata fails
or returns an unusable version, rather than rescuing to false. Preserve the
existing version check and apply the Folly definitions only after successful
detection.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 19e432fd-d50d-4e30-857f-4bf22768a669

📥 Commits

Reviewing files that changed from the base of the PR and between 994625a and 865310c.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • docs/docs/troubleshooting.md
  • package/NitroPay.podspec

Comment thread package/NitroPay.podspec Outdated
jkasprzyk17 and others added 2 commits September 16, 2026 13:29
Silent rescue-to-false could skip Folly flags on RN < 0.80 or hide a broken install. Raise during pod install instead, and compare versions with Gem::Version.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jkasprzyk17
jkasprzyk17 force-pushed the fix/ios-folly-no-config-rn80 branch from 865310c to 88f2ab5 Compare September 16, 2026 11:29
Use Open3.capture3 with chdir so installation_root is not interpolated into a shell command during pod install.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jkasprzyk17

Copy link
Copy Markdown
Contributor Author

Follow-up for CodeRabbit Security Check: replaced the backtick cd \"...\" && node ... with Open3.capture3(..., chdir: pod_root) so installation_root is never interpolated into a shell command.

@jkasprzyk17

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@jkasprzyk17
jkasprzyk17 merged commit 3150815 into main Sep 16, 2026
5 checks passed
jkasprzyk17 added a commit that referenced this pull request Sep 16, 2026
fix: iOS startup crash from FOLLY_NO_CONFIG on RN 0.80+
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