Skip to content

fix(react-native): Omits quotes in with-environment.sh parameter script in RN >= 0.81.1 - #1082

Merged
Lms24 merged 2 commits into
masterfrom
antonis/rn-fix-0.81.1-quotes
Sep 10, 2025
Merged

Lms24 merged 2 commits into
masterfrom
antonis/rn-fix-0.81.1-quotes

Conversation

@antonis

@antonis antonis commented Sep 10, 2025 •

Copy link
Copy Markdown
Contributor

Fixes getsentry/sentry-react-native#5118

Description

Omits quotes in with-environment.sh parameters script in RN >= 0.81.1 (introduced in with this change)

@codecov

codecov Bot commented Sep 10, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.00000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.16%. Comparing base (ed5fa20) to head (8f5b5d7).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/react-native/react-native-wizard.ts 0.00% 8 Missing ⚠️
src/react-native/xcode.ts 75.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1082      +/-   ##
==========================================
+ Coverage   32.04%   32.16%   +0.12%     
==========================================
  Files         133      133              
  Lines       15660    15675      +15     
  Branches     1093     1100       +7     
==========================================
+ Hits         5018     5042      +24     
+ Misses      10625    10616       -9     
  Partials       17       17              
Flag Coverage Δ
unit-tests 32.16% <45.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@antonis
antonis marked this pull request as ready for review September 10, 2025 08:52
@antonis
antonis requested a review from Lms24 September 10, 2025 08:52
Comment thread src/react-native/xcode.ts
Comment on lines +94 to +98
const useQuotes = fulfillsVersionRange({
version: rnVersion || 'latest',
acceptableVersions: '<0.81.1',
canBeLatest: false,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Potential bug: When the React Native version is undefined, the logic incorrectly defaults to behavior for newer versions (useQuotes = false), breaking iOS builds for projects on older versions that require quotes.
  • Description: If the React Native version is not found in package.json and the user opts to proceed, the rnVersion variable will be undefined. The logic in addSentryWithBundledScriptsToBundleShellScript defaults to using 'latest' for the version. This causes fulfillsVersionRange to return false because canBeLatest is false. As a result, useQuotes is set to false, which is incorrect for React Native versions below 0.81.1. This generates a malformed shell script, leading to a guaranteed iOS build failure for projects using these older versions.

  • Suggested fix: When rnVersion is undefined, the logic should default to the safer, backwards-compatible behavior where useQuotes is true. This ensures that projects with undetected or older React Native versions do not fail during the iOS build process due to incorrect shell script generation.
    severity: 0.82, confidence: 0.95

Did we get this right? 👍 / 👎 to inform future reviews.

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.

When the version is latest (> 0.81.1) quotes are not used as intended

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! I'll release this (and the other change) in a minute!

@Lms24
Lms24 merged commit a724f3a into master Sep 10, 2025
43 of 44 checks passed
@Lms24
Lms24 deleted the antonis/rn-fix-0.81.1-quotes branch September 10, 2025 09:16
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.

Sentry wizard will break RN from 81.1

2 participants