Skip to content

Commit 9da5c4e

Browse files
Merge 077a1bd into 623b5b8
2 parents 623b5b8 + 077a1bd commit 9da5c4e

File tree

6 files changed

+42
-41
lines changed

6 files changed

+42
-41
lines changed

CHANGELOG.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!-- prettier-ignore-start -->
44
> [!IMPORTANT]
5-
> If you are upgrading to the `6.x` versions of the Sentry React Native SDK from `5.x` or below,
5+
> If you are upgrading to the `7.x` versions of the Sentry React Native SDK from `6.x` or below,
66
> make sure you follow our [migration guide](https://docs.sentry.io/platforms/react-native/migration/) first.
77
<!-- prettier-ignore-end -->
88
@@ -172,6 +172,10 @@
172172

173173
To learn more about the available configuration options visit [the documentation](https://docs.sentry.io/platforms/react-native/manual-setup/expo/gradle).
174174

175+
### Changes
176+
177+
Change `Cold/Warm App Start` span description to `Cold/Warm Start` ([#4636](https://github.com/getsentry/sentry-react-native/pull/4636))
178+
175179
### Fixes
176180

177181
- Remove `error:` prefix from `collect-modules.sh` to avoid failing iOS builds ([#4570](https://github.com/getsentry/sentry-react-native/pull/4570))
@@ -182,9 +186,9 @@
182186

183187
### Dependencies
184188

185-
- Bump Android SDK from v7.20.1 to v7.22.0 ([#4529](https://github.com/getsentry/sentry-react-native/pull/4529))
186-
- [changelog](https://github.com/getsentry/sentry-java/blob/7.x.x/CHANGELOG.md#7220)
187-
- [diff](https://github.com/getsentry/sentry-java/compare/7.20.1...7.22.0)
189+
- Bump Android SDK from v7.20.1 to v8.3.0 ([#4490](https://github.com/getsentry/sentry-react-native/pull/4490))
190+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#830)
191+
- [diff](https://github.com/getsentry/sentry-java/compare/7.20.1...8.3.0)
188192
- Bump Cocoa SDK from v8.44.0 to v8.45.0 ([#4537](https://github.com/getsentry/sentry-react-native/pull/4537))
189193
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8450)
190194
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.44.0...8.45.0)

packages/core/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ android {
5454

5555
dependencies {
5656
implementation 'com.facebook.react:react-native:+'
57-
api 'io.sentry:sentry-android:7.22.5'
57+
api 'io.sentry:sentry-android:8.3.0'
5858
}

packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
import com.facebook.react.bridge.WritableNativeMap;
3131
import com.facebook.react.common.JavascriptException;
3232
import io.sentry.Breadcrumb;
33-
import io.sentry.HubAdapter;
3433
import io.sentry.ILogger;
3534
import io.sentry.IScope;
3635
import io.sentry.ISentryExecutorService;
3736
import io.sentry.ISerializer;
3837
import io.sentry.Integration;
38+
import io.sentry.ScopesAdapter;
3939
import io.sentry.Sentry;
4040
import io.sentry.SentryDate;
4141
import io.sentry.SentryDateProvider;
@@ -87,6 +87,7 @@
8787
import java.util.List;
8888
import java.util.Map;
8989
import java.util.Properties;
90+
import java.util.Set;
9091
import java.util.concurrent.CountDownLatch;
9192
import org.jetbrains.annotations.NotNull;
9293
import org.jetbrains.annotations.Nullable;
@@ -516,7 +517,7 @@ public void fetchNativeFrames(Promise promise) {
516517
}
517518

518519
public void captureReplay(boolean isHardCrash, Promise promise) {
519-
Sentry.getCurrentHub().getOptions().getReplayController().captureReplay(isHardCrash);
520+
Sentry.getCurrentScopes().getOptions().getReplayController().captureReplay(isHardCrash);
520521
promise.resolve(getCurrentReplayId());
521522
}
522523

@@ -612,7 +613,7 @@ public void fetchViewHierarchy(Promise promise) {
612613
return;
613614
}
614615

615-
ISerializer serializer = HubAdapter.getInstance().getOptions().getSerializer();
616+
ISerializer serializer = ScopesAdapter.getInstance().getOptions().getSerializer();
616617
final @Nullable byte[] bytes =
617618
JsonSerializationUtils.bytesFrom(serializer, logger, viewHierarchy);
618619
if (bytes == null) {
@@ -666,10 +667,6 @@ public void setUser(final ReadableMap userKeys, final ReadableMap userDataKeys)
666667
if (userKeys.hasKey("ip_address")) {
667668
userInstance.setIpAddress(userKeys.getString("ip_address"));
668669
}
669-
670-
if (userKeys.hasKey("segment")) {
671-
userInstance.setSegment(userKeys.getString("segment"));
672-
}
673670
}
674671

675672
if (userDataKeys != null) {
@@ -831,8 +828,7 @@ private void initializeAndroidProfiler() {
831828
(int) SECONDS.toMicros(1) / profilingTracesHz,
832829
new SentryFrameMetricsCollector(reactApplicationContext, logger, buildInfo),
833830
executorService,
834-
logger,
835-
buildInfo);
831+
logger);
836832
}
837833

838834
public WritableMap startProfiling(boolean platformProfilers) {
@@ -856,7 +852,7 @@ public WritableMap startProfiling(boolean platformProfilers) {
856852
}
857853

858854
public WritableMap stopProfiling() {
859-
final boolean isDebug = HubAdapter.getInstance().getOptions().isDebug();
855+
final boolean isDebug = ScopesAdapter.getInstance().getOptions().isDebug();
860856
final WritableMap result = new WritableNativeMap();
861857
File output = null;
862858
try {
@@ -942,7 +938,7 @@ private String readStringFromFile(File path) throws IOException {
942938
}
943939

944940
public void fetchNativeDeviceContexts(Promise promise) {
945-
final @NotNull SentryOptions options = HubAdapter.getInstance().getOptions();
941+
final @NotNull SentryOptions options = ScopesAdapter.getInstance().getOptions();
946942
final @Nullable Context context = this.getReactApplicationContext().getApplicationContext();
947943
final @Nullable IScope currentScope = InternalSentrySdk.getCurrentScope();
948944
fetchNativeDeviceContexts(promise, options, context, currentScope);
@@ -979,7 +975,8 @@ protected void fetchNativeDeviceContexts(
979975
}
980976

981977
public void fetchNativeSdkInfo(Promise promise) {
982-
final @Nullable SdkVersion sdkVersion = HubAdapter.getInstance().getOptions().getSdkVersion();
978+
final @Nullable SdkVersion sdkVersion =
979+
ScopesAdapter.getInstance().getOptions().getSdkVersion();
983980
if (sdkVersion == null) {
984981
promise.resolve(null);
985982
} else {
@@ -1058,14 +1055,14 @@ private void addPackages(SentryEvent event, SdkVersion sdk) {
10581055
if (eventSdk != null
10591056
&& "sentry.javascript.react-native".equals(eventSdk.getName())
10601057
&& sdk != null) {
1061-
List<SentryPackage> sentryPackages = sdk.getPackages();
1058+
Set<SentryPackage> sentryPackages = sdk.getPackageSet();
10621059
if (sentryPackages != null) {
10631060
for (SentryPackage sentryPackage : sentryPackages) {
10641061
eventSdk.addPackage(sentryPackage.getName(), sentryPackage.getVersion());
10651062
}
10661063
}
10671064

1068-
List<String> integrations = sdk.getIntegrations();
1065+
Set<String> integrations = sdk.getIntegrationSet();
10691066
if (integrations != null) {
10701067
for (String integration : integrations) {
10711068
eventSdk.addIntegration(integration);

packages/core/src/js/tracing/integrations/appStart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export const appStartIntegration = ({
361361
const op = appStart.type === 'cold' ? APP_START_COLD_OP : APP_START_WARM_OP;
362362
const appStartSpanJSON: SpanJSON = createSpanJSON({
363363
op,
364-
description: appStart.type === 'cold' ? 'Cold App Start' : 'Warm App Start',
364+
description: appStart.type === 'cold' ? 'Cold Start' : 'Warm Start',
365365
start_timestamp: appStartTimestampSeconds,
366366
timestamp: appStartEndTimestampSeconds,
367367
trace_id: event.contexts.trace.trace_id,

packages/core/test/tracing/integrations/appStart.test.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ describe('App Start Integration', () => {
157157

158158
const actualEvent = await captureStandAloneAppStart();
159159

160-
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
160+
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
161161
const bundleStartSpan = actualEvent!.spans!.find(
162162
({ description }) => description === 'JS Bundle Execution Start',
163163
);
164164

165165
expect(appStartRootSpan).toEqual(
166166
expect.objectContaining(<Partial<SpanJSON>>{
167167
span_id: expect.any(String),
168-
description: 'Cold App Start',
168+
description: 'Cold Start',
169169
op: APP_START_COLD_OP,
170170
data: {
171171
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: APP_START_COLD_OP,
@@ -195,15 +195,15 @@ describe('App Start Integration', () => {
195195

196196
const actualEvent = await captureStandAloneAppStart();
197197

198-
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
198+
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
199199
const bundleStartSpan = actualEvent!.spans!.find(
200200
({ description }) => description === 'JS Bundle Execution Before React Root',
201201
);
202202

203203
expect(appStartRootSpan).toEqual(
204204
expect.objectContaining(<Partial<SpanJSON>>{
205205
span_id: expect.any(String),
206-
description: 'Cold App Start',
206+
description: 'Cold Start',
207207
op: APP_START_COLD_OP,
208208
data: {
209209
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: APP_START_COLD_OP,
@@ -234,13 +234,13 @@ describe('App Start Integration', () => {
234234

235235
const actualEvent = await captureStandAloneAppStart();
236236

237-
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
237+
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
238238
const nativeSpan = actualEvent!.spans!.find(({ description }) => description === 'test native app start span');
239239

240240
expect(appStartRootSpan).toEqual(
241241
expect.objectContaining(<Partial<SpanJSON>>{
242242
span_id: expect.any(String),
243-
description: 'Cold App Start',
243+
description: 'Cold Start',
244244
op: APP_START_COLD_OP,
245245
data: {
246246
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: APP_START_COLD_OP,
@@ -472,14 +472,14 @@ describe('App Start Integration', () => {
472472

473473
const actualEvent = await processEvent(getMinimalTransactionEvent());
474474

475-
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
475+
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
476476
const bundleStartSpan = actualEvent!.spans!.find(
477477
({ description }) => description === 'JS Bundle Execution Start',
478478
);
479479

480480
expect(appStartRootSpan).toEqual(
481481
expect.objectContaining(<Partial<SpanJSON>>{
482-
description: 'Cold App Start',
482+
description: 'Cold Start',
483483
span_id: expect.any(String),
484484
op: APP_START_COLD_OP,
485485
origin: SPAN_ORIGIN_AUTO_APP_START,
@@ -512,14 +512,14 @@ describe('App Start Integration', () => {
512512

513513
const actualEvent = await processEvent(getMinimalTransactionEvent());
514514

515-
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
515+
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
516516
const bundleStartSpan = actualEvent!.spans!.find(
517517
({ description }) => description === 'JS Bundle Execution Before React Root',
518518
);
519519

520520
expect(appStartRootSpan).toEqual(
521521
expect.objectContaining(<Partial<SpanJSON>>{
522-
description: 'Cold App Start',
522+
description: 'Cold Start',
523523
span_id: expect.any(String),
524524
op: APP_START_COLD_OP,
525525
origin: SPAN_ORIGIN_AUTO_APP_START,
@@ -552,14 +552,14 @@ describe('App Start Integration', () => {
552552

553553
const actualEvent = await processEvent(getMinimalTransactionEvent());
554554

555-
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
555+
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
556556
const bundleStartSpan = actualEvent!.spans!.find(
557557
({ description }) => description === 'JS Bundle Execution Before React Root',
558558
);
559559

560560
expect(appStartRootSpan).toEqual(
561561
expect.objectContaining(<Partial<SpanJSON>>{
562-
description: 'Cold App Start',
562+
description: 'Cold Start',
563563
span_id: expect.any(String),
564564
op: APP_START_COLD_OP,
565565
origin: SPAN_ORIGIN_AUTO_APP_START,
@@ -593,12 +593,12 @@ describe('App Start Integration', () => {
593593

594594
const actualEvent = await processEvent(getMinimalTransactionEvent());
595595

596-
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
596+
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
597597
const nativeSpan = actualEvent!.spans!.find(({ description }) => description === 'test native app start span');
598598

599599
expect(appStartRootSpan).toEqual(
600600
expect.objectContaining(<Partial<SpanJSON>>{
601-
description: 'Cold App Start',
601+
description: 'Cold Start',
602602
span_id: expect.any(String),
603603
op: APP_START_COLD_OP,
604604
origin: SPAN_ORIGIN_AUTO_APP_START,
@@ -873,7 +873,7 @@ function expectEventWithAttachedColdAppStart({
873873
spans: expect.arrayContaining<SpanJSON>([
874874
{
875875
op: APP_START_COLD_OP,
876-
description: 'Cold App Start',
876+
description: 'Cold Start',
877877
start_timestamp: appStartTimeMilliseconds / 1000,
878878
timestamp: expect.any(Number),
879879
trace_id: expect.any(String),
@@ -927,7 +927,7 @@ function expectEventWithAttachedWarmAppStart({
927927
spans: expect.arrayContaining<SpanJSON>([
928928
{
929929
op: APP_START_WARM_OP,
930-
description: 'Warm App Start',
930+
description: 'Warm Start',
931931
start_timestamp: appStartTimeMilliseconds / 1000,
932932
timestamp: expect.any(Number),
933933
trace_id: expect.any(String),
@@ -984,7 +984,7 @@ function expectEventWithStandaloneColdAppStart(
984984
spans: expect.arrayContaining<SpanJSON>([
985985
{
986986
op: APP_START_COLD_OP,
987-
description: 'Cold App Start',
987+
description: 'Cold Start',
988988
start_timestamp: appStartTimeMilliseconds / 1000,
989989
timestamp: expect.any(Number),
990990
trace_id: expect.any(String),
@@ -1033,7 +1033,7 @@ function expectEventWithStandaloneWarmAppStart(
10331033
spans: expect.arrayContaining<SpanJSON>([
10341034
{
10351035
op: APP_START_WARM_OP,
1036-
description: 'Warm App Start',
1036+
description: 'Warm Start',
10371037
start_timestamp: appStartTimeMilliseconds / 1000,
10381038
timestamp: expect.any(Number),
10391039
trace_id: expect.any(String),

packages/core/test/tracing/reactnavigation.ttid.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ describe('React Navigation - TTID', () => {
255255
type: 'transaction',
256256
spans: expect.arrayContaining([
257257
expect.objectContaining<Partial<SpanJSON>>({
258-
description: 'Cold App Start',
258+
description: 'Cold Start',
259259
}),
260260
expect.objectContaining<Partial<SpanJSON>>({
261261
data: {
@@ -296,7 +296,7 @@ describe('React Navigation - TTID', () => {
296296
type: 'transaction',
297297
spans: expect.arrayContaining([
298298
expect.objectContaining<Partial<SpanJSON>>({
299-
description: 'Cold App Start',
299+
description: 'Cold Start',
300300
}),
301301
expect.objectContaining<Partial<SpanJSON>>({
302302
data: {
@@ -327,7 +327,7 @@ describe('React Navigation - TTID', () => {
327327
type: 'transaction',
328328
spans: expect.arrayContaining([
329329
expect.objectContaining<Partial<SpanJSON>>({
330-
description: 'Cold App Start',
330+
description: 'Cold Start',
331331
}),
332332
]),
333333
measurements: expect.objectContaining<Required<TransactionEvent>['measurements']>({

0 commit comments

Comments
 (0)