Skip to content

Commit e5fcbef

Browse files
Merge f5f711d into 86bf3b5
2 parents 86bf3b5 + f5f711d commit e5fcbef

File tree

7 files changed

+116
-26
lines changed

7 files changed

+116
-26
lines changed

.github/workflows/e2e.yml

+6-15
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ concurrency:
1313

1414
env:
1515
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
16+
IOS_DEVICE: 'iPhone 16'
17+
IOS_RUNTIME: '18.1'
1618

1719
jobs:
1820
diff_check:
@@ -42,7 +44,7 @@ jobs:
4244
platform: ["ios", "android"]
4345
include:
4446
- platform: ios
45-
runs-on: macos-12
47+
runs-on: macos-13
4648
name: iOS
4749
appPlain: test/perf/test-app-plain.ipa
4850
- platform: android
@@ -172,8 +174,6 @@ jobs:
172174
USE_FRAMEWORKS: ${{ matrix.ios-use-frameworks }}
173175
PRODUCTION: ${{ matrix.build-type == 'production' && '1' || '0' }}
174176
RCT_NEW_ARCH_ENABLED: ${{ matrix.rn-architecture == 'new' && '1' || '0' }}
175-
IOS_RUNTIME: ${{ matrix.runtime }}
176-
IOS_DEVICE: ${{ matrix.device }}
177177
strategy:
178178
fail-fast: false # keeps matrix running if one fails
179179
matrix:
@@ -187,13 +187,9 @@ jobs:
187187
- platform: ios
188188
rn-version: '0.73.9'
189189
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
190-
runtime: 'latest'
191-
device: 'iPhone 14'
192190
- platform: ios
193191
rn-version: '0.65.3'
194-
runs-on: macos-12
195-
runtime: 'latest'
196-
device: 'iPhone 14'
192+
runs-on: macos-13
197193
- platform: android
198194
runs-on: ubuntu-latest
199195
exclude:
@@ -344,14 +340,10 @@ jobs:
344340
include:
345341
- platform: ios
346342
rn-version: '0.73.9'
347-
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
348-
runtime: 'latest'
349-
device: 'iPhone 14'
343+
runs-on: macos-15
350344
- platform: ios
351345
rn-version: '0.65.3'
352-
runs-on: macos-latest
353-
runtime: 'latest'
354-
device: 'iPhone 14'
346+
runs-on: macos-15
355347
- platform: android
356348
runs-on: ubuntu-latest
357349
exclude:
@@ -369,7 +361,6 @@ jobs:
369361
rn-architecture: 'new'
370362
env:
371363
PLATFORM: ${{ matrix.platform }}
372-
DEVICE: ${{ matrix.device }}
373364
steps:
374365
- uses: actions/checkout@v4
375366

.github/workflows/native-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
test-ios:
2525
name: ios
26-
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
26+
runs-on: macos-15
2727
needs: [diff_check]
2828
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
2929
steps:
@@ -49,7 +49,7 @@ jobs:
4949
env:
5050
SCHEME: RNSentryCocoaTester
5151
CONFIGURATION: Release
52-
DESTINATION: 'platform=iOS Simulator,OS=latest,name=iPhone 14'
52+
DESTINATION: 'platform=iOS Simulator,OS=latest,name=iPhone 16'
5353
run: |
5454
env NSUnbufferedIO=YES \
5555
xcodebuild -workspace *.xcworkspace \

.github/workflows/sample-application.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,9 @@ jobs:
4646
build-type: ['dev', 'production']
4747
include:
4848
- platform: ios
49-
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
50-
runtime: 'latest'
51-
device: 'iPhone 14'
49+
runs-on: macos-15
5250
- platform: macos
53-
runs-on: macos-14
51+
runs-on: macos-15
5452
- platform: android
5553
runs-on: ubuntu-latest
5654
exclude:
@@ -143,7 +141,8 @@ jobs:
143141
-workspace sentryreactnativesample.xcworkspace \
144142
-configuration "$CONFIG" \
145143
-scheme sentryreactnativesample \
146-
-destination 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}' \
144+
-sdk 'iphonesimulator' \
145+
-destination 'generic/platform=iOS Simulator' \
147146
ONLY_ACTIVE_ARCH=yes \
148147
-derivedDataPath "$derivedData" \
149148
build \

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- `browserReplayIntegration` is no longer included by default on React Native Web ([#4270](https://github.com/getsentry/sentry-react-native/pull/4270), [#4308](https://github.com/getsentry/sentry-react-native/pull/4308))
8+
39
## 5.35.0
410

511
### Fixes

scripts/e2e.mjs

+4-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ if (actions.includes('build')) {
152152
-workspace ${appName}.xcworkspace \
153153
-configuration ${buildType} \
154154
-scheme ${appName} \
155-
-destination 'platform=iOS Simulator,OS=${runtime},name=${device}' \
155+
-sdk 'iphonesimulator' \
156+
-destination 'generic/platform=iOS Simulator' \
156157
ONLY_ACTIVE_ARCH=yes \
157158
-derivedDataPath DerivedData \
158159
build | tee xcodebuild.log | xcbeautify`,
@@ -181,7 +182,8 @@ if (actions.includes('test')) {
181182
execSync(`set -o pipefail && xcodebuild \
182183
-project node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj \
183184
-scheme WebDriverAgentRunner \
184-
-destination 'platform=iOS Simulator,OS=${runtime},name=${device}' \
185+
-sdk 'iphonesimulator' \
186+
-destination 'generic/platform=iOS Simulator' \
185187
GCC_TREAT_WARNINGS_AS_ERRORS=0 \
186188
COMPILER_INDEX_STORE_ENABLE=NO \
187189
ONLY_ACTIVE_ARCH=yes \

src/js/integrations/default.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
browserApiErrorsIntegration,
1111
browserGlobalHandlersIntegration,
1212
browserLinkedErrorsIntegration,
13-
browserReplayIntegration,
1413
debugSymbolicatorIntegration,
1514
dedupeIntegration,
1615
deviceContextIntegration,
@@ -120,10 +119,13 @@ export function getDefaultIntegrations(options: ReactNativeClientOptions): Integ
120119
(options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||
121120
(options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number')
122121
) {
123-
integrations.push(notWeb() ? mobileReplayIntegration() : browserReplayIntegration());
124122
if (!notWeb()) {
123+
// We can't create and add browserReplayIntegration as it overrides the users supplied one
124+
// The browser replay integration works differently than the rest of default integrations
125125
(options as BrowserOptions).replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;
126126
(options as BrowserOptions).replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;
127+
} else {
128+
integrations.push(mobileReplayIntegration());
127129
}
128130
}
129131

test/sdk.test.ts

+90
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,96 @@ describe('Tests the SDK functionality', () => {
648648

649649
expect(actualIntegrations).toEqual(expect.arrayContaining([expect.objectContaining({ name: 'ExpoContext' })]));
650650
});
651+
652+
it('adds mobile replay integration when _experiments.replaysOnErrorSampleRate is set', () => {
653+
init({
654+
_experiments: {
655+
replaysOnErrorSampleRate: 1.0,
656+
},
657+
});
658+
659+
const actualOptions = usedOptions();
660+
const actualIntegrations = actualOptions?.integrations;
661+
expect(actualIntegrations).toEqual(expect.arrayContaining([expect.objectContaining({ name: 'MobileReplay' })]));
662+
});
663+
664+
it('adds mobile replay integration when _experiments.replaysSessionSampleRate is set', () => {
665+
init({
666+
_experiments: {
667+
replaysSessionSampleRate: 1.0,
668+
},
669+
});
670+
671+
const actualOptions = usedOptions();
672+
const actualIntegrations = actualOptions?.integrations;
673+
expect(actualIntegrations).toEqual(expect.arrayContaining([expect.objectContaining({ name: 'MobileReplay' })]));
674+
});
675+
676+
it('does not add mobile replay integration when no replay sample rates are set', () => {
677+
init({
678+
_experiments: {},
679+
});
680+
681+
const actualOptions = usedOptions();
682+
const actualIntegrations = actualOptions?.integrations;
683+
expect(actualIntegrations).toEqual(expect.not.arrayContaining([expect.objectContaining({ name: 'MobileReplay' })]));
684+
});
685+
686+
it('does not add any replay integration when on web even with on error sample rate', () => {
687+
(notWeb as jest.Mock).mockImplementation(() => false);
688+
init({
689+
_experiments: {
690+
replaysOnErrorSampleRate: 1.0,
691+
},
692+
});
693+
694+
const actualOptions = usedOptions();
695+
const actualIntegrations = actualOptions?.integrations;
696+
expect(actualIntegrations).toEqual(expect.not.arrayContaining([expect.objectContaining({ name: 'Replay' })]));
697+
expect(actualIntegrations).toEqual(expect.not.arrayContaining([expect.objectContaining({ name: 'MobileReplay' })]));
698+
});
699+
700+
it('does not add any replay integration when on web even with session sample rate', () => {
701+
(notWeb as jest.Mock).mockImplementation(() => false);
702+
init({
703+
_experiments: {
704+
replaysSessionSampleRate: 1.0,
705+
},
706+
});
707+
708+
const actualOptions = usedOptions();
709+
const actualIntegrations = actualOptions?.integrations;
710+
expect(actualIntegrations).toEqual(expect.not.arrayContaining([expect.objectContaining({ name: 'Replay' })]));
711+
expect(actualIntegrations).toEqual(expect.not.arrayContaining([expect.objectContaining({ name: 'MobileReplay' })]));
712+
});
713+
714+
it('does not add any replay integration when on web', () => {
715+
(notWeb as jest.Mock).mockImplementation(() => false);
716+
init({});
717+
718+
const actualOptions = usedOptions();
719+
const actualIntegrations = actualOptions?.integrations;
720+
expect(actualIntegrations).toEqual(expect.not.arrayContaining([expect.objectContaining({ name: 'Replay' })]));
721+
expect(actualIntegrations).toEqual(expect.not.arrayContaining([expect.objectContaining({ name: 'MobileReplay' })]));
722+
});
723+
724+
it('converts experimental replay options to standard web options when on web', () => {
725+
(notWeb as jest.Mock).mockImplementation(() => false);
726+
init({
727+
_experiments: {
728+
replaysOnErrorSampleRate: 0.5,
729+
replaysSessionSampleRate: 0.1,
730+
},
731+
});
732+
733+
const actualOptions = usedOptions();
734+
expect(actualOptions).toEqual(
735+
expect.objectContaining({
736+
replaysOnErrorSampleRate: 0.5,
737+
replaysSessionSampleRate: 0.1,
738+
}),
739+
);
740+
});
651741
});
652742

653743
function createMockedIntegration({ name }: { name?: string } = {}): Integration {

0 commit comments

Comments
 (0)