Skip to content

Commit 52808bd

Browse files
committed
ref: Rename initial transaction on V4 to 'App Launch'
1 parent 4fb1fdc commit 52808bd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/js/tracing/reactnavigationv4.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class ReactNavigationV4Instrumentation extends RoutingInstrumentation {
104104
*/
105105
private _handleInitialState(): void {
106106
this._latestTransaction = this.onRouteWillChange(
107-
BLANK_TRANSACTION_CONTEXT_V4
107+
INITIAL_TRANSACTION_CONTEXT_V4
108108
);
109109

110110
// We set this to true so when registerAppContainer is called, the transaction gets updated with the actual route data
@@ -258,8 +258,8 @@ class ReactNavigationV4Instrumentation extends RoutingInstrumentation {
258258
};
259259
}
260260

261-
const BLANK_TRANSACTION_CONTEXT_V4 = {
262-
name: "Route Change",
261+
const INITIAL_TRANSACTION_CONTEXT_V4 = {
262+
name: "App Launch",
263263
op: "navigation",
264264
tags: {
265265
"routing.instrumentation":
@@ -268,4 +268,4 @@ const BLANK_TRANSACTION_CONTEXT_V4 = {
268268
data: {},
269269
};
270270

271-
export { ReactNavigationV4Instrumentation, BLANK_TRANSACTION_CONTEXT_V4 };
271+
export { ReactNavigationV4Instrumentation, INITIAL_TRANSACTION_CONTEXT_V4 };

test/tracing/reactnavigationv4.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { Transaction } from "@sentry/tracing";
33

44
import {
55
AppContainerInstance,
6-
BLANK_TRANSACTION_CONTEXT_V4,
6+
INITIAL_TRANSACTION_CONTEXT_V4,
77
NavigationRouteV4,
88
NavigationStateV4,
99
ReactNavigationV4Instrumentation,
1010
} from "../../src/js/tracing/reactnavigationv4";
1111

1212
const getMockTransaction = () => {
13-
const transaction = new Transaction(BLANK_TRANSACTION_CONTEXT_V4);
13+
const transaction = new Transaction(INITIAL_TRANSACTION_CONTEXT_V4);
1414

1515
transaction.sampled = false;
1616

@@ -106,7 +106,7 @@ describe("ReactNavigationV4Instrumentation", () => {
106106

107107
// eslint-disable-next-line @typescript-eslint/unbound-method
108108
expect(instrumentation.onRouteWillChange).toHaveBeenLastCalledWith(
109-
BLANK_TRANSACTION_CONTEXT_V4
109+
INITIAL_TRANSACTION_CONTEXT_V4
110110
);
111111

112112
expect(mockTransaction.name).toBe(firstRoute.routeName);

0 commit comments

Comments
 (0)