Repository navigation
fix(react-native): Omits quotes in with-environment.sh parameter script in RN >= 0.81.1 - #1082
Conversation
…pt in RN >= 0.81.1
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| const useQuotes = fulfillsVersionRange({ | ||
| version: rnVersion || 'latest', | ||
| acceptableVersions: '<0.81.1', | ||
| canBeLatest: false, | ||
| }); |
There was a problem hiding this comment.
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.jsonand the user opts to proceed, thernVersionvariable will beundefined. The logic inaddSentryWithBundledScriptsToBundleShellScriptdefaults to using'latest'for the version. This causesfulfillsVersionRangeto returnfalsebecausecanBeLatestisfalse. As a result,useQuotesis set tofalse, 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
rnVersionisundefined, the logic should default to the safer, backwards-compatible behavior whereuseQuotesistrue. 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.
There was a problem hiding this comment.
When the version is latest (> 0.81.1) quotes are not used as intended
Lms24
left a comment
There was a problem hiding this comment.
Thanks! I'll release this (and the other change) in a minute!
Fixes getsentry/sentry-react-native#5118
Description
Omits quotes in
with-environment.shparameters script in RN >=0.81.1(introduced in with this change)