Skip to content

Commit a034d79

Browse files
authored
Merge branch 'main' into antonis/rn-675-add-api-to-extend-app-start-react-native
2 parents c8be3b7 + 513aeb3 commit a034d79

3 files changed

Lines changed: 42 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
- Add experimental `extendAppStart`/`finishExtendedAppStart`/`getExtendedAppStartSpan` to extend the standalone app start window and instrument post-init work ([#6392](https://github.com/getsentry/sentry-react-native/pull/6392))
1414

15+
### Fixes
16+
17+
- Skip iOS source maps upload on `Debug` builds ([#6405](https://github.com/getsentry/sentry-react-native/pull/6405))
18+
1519
## 8.17.2
1620

1721
### Fixes

packages/core/scripts/sentry-xcode.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,18 @@ REACT_NATIVE_XCODE_WITH_SENTRY="\"$SENTRY_CLI_EXECUTABLE\" react-native xcode $A
6565

6666
exitCode=0
6767

68-
if [ "$SENTRY_DISABLE_AUTO_UPLOAD" != true ]; then
68+
if [ "$SENTRY_DISABLE_AUTO_UPLOAD" == true ]; then
69+
echo "SENTRY_DISABLE_AUTO_UPLOAD=true, skipping sourcemaps upload"
70+
/bin/sh -c "$REACT_NATIVE_XCODE"
71+
elif echo "$CONFIGURATION" | grep -iq "debug"; then # case insensitive check for "debug"
72+
# Skip the source maps upload for *Debug* configuration, matching the behavior of the
73+
# native debug files upload (sentry-xcode-debug-files.sh) and the Android Gradle plugin.
74+
# Local Debug builds should not require Sentry credentials. Still run the React Native
75+
# bundling step so the build itself succeeds.
76+
# See: https://github.com/getsentry/sentry-react-native/issues/6399
77+
echo "Skipping source maps upload for *Debug* configuration"
78+
/bin/sh -c "$REACT_NATIVE_XCODE"
79+
else
6980
# 'warning:' triggers a warning in Xcode, 'error:' triggers an error
7081
set +x +e # disable printing commands otherwise we might print `error:` by accident and allow continuing on error
7182
SENTRY_XCODE_COMMAND_OUTPUT=$(/bin/sh -c "\"$LOCAL_NODE_BINARY\" $REACT_NATIVE_XCODE_WITH_SENTRY" 2>&1)
@@ -82,9 +93,6 @@ if [ "$SENTRY_DISABLE_AUTO_UPLOAD" != true ]; then
8293
fi
8394
fi
8495
set -x -e # re-enable
85-
else
86-
echo "SENTRY_DISABLE_AUTO_UPLOAD=true, skipping sourcemaps upload"
87-
/bin/sh -c "$REACT_NATIVE_XCODE"
8896
fi
8997

9098
[ -z "$SENTRY_COLLECT_MODULES" ] && SENTRY_RN_PACKAGE_PATH=$("$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/react-native/package.json'))")

packages/core/test/scripts/sentry-xcode-scripts.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,32 @@ describe('sentry-xcode.sh', () => {
455455
expect(result.stdout).toContain('skipping sourcemaps upload');
456456
});
457457

458+
it('skips upload for Debug configuration without invoking sentry-cli', () => {
459+
const result = runScript({
460+
CONFIGURATION: 'Debug',
461+
// A failing sentry-cli would surface here if it were invoked; the Debug skip must run
462+
// the React Native bundling step directly instead. See issue #6399.
463+
MOCK_CLI_EXIT_CODE: '1',
464+
MOCK_CLI_OUTPUT: 'An organization ID or slug is required',
465+
});
466+
467+
expect(result.exitCode).toBe(0);
468+
expect(result.stdout).toContain('Skipping source maps upload for *Debug* configuration');
469+
expect(result.stdout).toContain('Mock React Native bundle');
470+
expect(result.stdout).not.toContain('An organization ID or slug is required');
471+
expect(result.stdout).not.toContain('error: sentry-cli');
472+
});
473+
474+
it('skips upload for debug configuration (case insensitive)', () => {
475+
const result = runScript({
476+
CONFIGURATION: 'debug',
477+
});
478+
479+
expect(result.exitCode).toBe(0);
480+
expect(result.stdout).toContain('Skipping source maps upload for *Debug* configuration');
481+
expect(result.stdout).toContain('Mock React Native bundle');
482+
});
483+
458484
describe('SENTRY_PROJECT_ROOT override', () => {
459485
it('resolves SOURCEMAP_FILE relative to SENTRY_PROJECT_ROOT instead of PROJECT_DIR/..', () => {
460486
const customRoot = path.join(tempDir, 'monorepo-package');

0 commit comments

Comments
 (0)