Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v7.0.0 #4653

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

Expand All @@ -28,15 +28,19 @@

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

### Changes

Change `Cold/Warm App Start` span description to `Cold/Warm Start` ([#4636](https://github.com/getsentry/sentry-react-native/pull/4636))

### Fixes

- Various crashes and issues of Session Replay on Android. See the Android SDK version bump for more details. ([#4529](https://github.com/getsentry/sentry-react-native/pull/4529))

### Dependencies

- Bump Android SDK from v7.20.1 to v7.22.0 ([#4529](https://github.com/getsentry/sentry-react-native/pull/4529))
- [changelog](https://github.com/getsentry/sentry-java/blob/7.x.x/CHANGELOG.md#7220)
- [diff](https://github.com/getsentry/sentry-java/compare/7.20.1...7.22.0)
- Bump Android SDK from v7.20.1 to v8.3.0 ([#4490](https://github.com/getsentry/sentry-react-native/pull/4490))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#830)
- [diff](https://github.com/getsentry/sentry-java/compare/7.20.1...8.3.0)
- Bump Cocoa SDK from v8.44.0 to v8.45.0 ([#4537](https://github.com/getsentry/sentry-react-native/pull/4537))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8450)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.44.0...8.45.0)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ android {

dependencies {
implementation 'com.facebook.react:react-native:+'
api 'io.sentry:sentry-android:7.22.0'
api 'io.sentry:sentry-android:8.3.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
import com.facebook.react.common.JavascriptException;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import io.sentry.Breadcrumb;
import io.sentry.HubAdapter;
import io.sentry.ILogger;
import io.sentry.IScope;
import io.sentry.ISentryExecutorService;
import io.sentry.ISerializer;
import io.sentry.Integration;
import io.sentry.ScopesAdapter;
import io.sentry.Sentry;
import io.sentry.SentryDate;
import io.sentry.SentryDateProvider;
Expand Down Expand Up @@ -85,6 +85,7 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -505,7 +506,7 @@ public void fetchNativeFrames(Promise promise) {
}

public void captureReplay(boolean isHardCrash, Promise promise) {
Sentry.getCurrentHub().getOptions().getReplayController().captureReplay(isHardCrash);
Sentry.getCurrentScopes().getOptions().getReplayController().captureReplay(isHardCrash);
promise.resolve(getCurrentReplayId());
}

Expand Down Expand Up @@ -601,7 +602,7 @@ public void fetchViewHierarchy(Promise promise) {
return;
}

ISerializer serializer = HubAdapter.getInstance().getOptions().getSerializer();
ISerializer serializer = ScopesAdapter.getInstance().getOptions().getSerializer();
final @Nullable byte[] bytes =
JsonSerializationUtils.bytesFrom(serializer, logger, viewHierarchy);
if (bytes == null) {
Expand Down Expand Up @@ -655,10 +656,6 @@ public void setUser(final ReadableMap userKeys, final ReadableMap userDataKeys)
if (userKeys.hasKey("ip_address")) {
userInstance.setIpAddress(userKeys.getString("ip_address"));
}

if (userKeys.hasKey("segment")) {
userInstance.setSegment(userKeys.getString("segment"));
}
}

if (userDataKeys != null) {
Expand Down Expand Up @@ -807,8 +804,7 @@ private void initializeAndroidProfiler() {
(int) SECONDS.toMicros(1) / profilingTracesHz,
new SentryFrameMetricsCollector(reactApplicationContext, logger, buildInfo),
executorService,
logger,
buildInfo);
logger);
}

public WritableMap startProfiling(boolean platformProfilers) {
Expand All @@ -832,7 +828,7 @@ public WritableMap startProfiling(boolean platformProfilers) {
}

public WritableMap stopProfiling() {
final boolean isDebug = HubAdapter.getInstance().getOptions().isDebug();
final boolean isDebug = ScopesAdapter.getInstance().getOptions().isDebug();
final WritableMap result = new WritableNativeMap();
File output = null;
try {
Expand Down Expand Up @@ -918,7 +914,7 @@ private String readStringFromFile(File path) throws IOException {
}

public void fetchNativeDeviceContexts(Promise promise) {
final @NotNull SentryOptions options = HubAdapter.getInstance().getOptions();
final @NotNull SentryOptions options = ScopesAdapter.getInstance().getOptions();
final @Nullable Context context = this.getReactApplicationContext().getApplicationContext();
final @Nullable IScope currentScope = InternalSentrySdk.getCurrentScope();
fetchNativeDeviceContexts(promise, options, context, currentScope);
Expand Down Expand Up @@ -955,7 +951,8 @@ protected void fetchNativeDeviceContexts(
}

public void fetchNativeSdkInfo(Promise promise) {
final @Nullable SdkVersion sdkVersion = HubAdapter.getInstance().getOptions().getSdkVersion();
final @Nullable SdkVersion sdkVersion =
ScopesAdapter.getInstance().getOptions().getSdkVersion();
if (sdkVersion == null) {
promise.resolve(null);
} else {
Expand Down Expand Up @@ -1001,14 +998,14 @@ private void addPackages(SentryEvent event, SdkVersion sdk) {
if (eventSdk != null
&& "sentry.javascript.react-native".equals(eventSdk.getName())
&& sdk != null) {
List<SentryPackage> sentryPackages = sdk.getPackages();
Set<SentryPackage> sentryPackages = sdk.getPackageSet();
if (sentryPackages != null) {
for (SentryPackage sentryPackage : sentryPackages) {
eventSdk.addPackage(sentryPackage.getName(), sentryPackage.getVersion());
}
}

List<String> integrations = sdk.getIntegrations();
Set<String> integrations = sdk.getIntegrationSet();
if (integrations != null) {
for (String integration : integrations) {
eventSdk.addIntegration(integration);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/js/tracing/integrations/appStart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export const appStartIntegration = ({
const op = appStart.type === 'cold' ? APP_START_COLD_OP : APP_START_WARM_OP;
const appStartSpanJSON: SpanJSON = createSpanJSON({
op,
description: appStart.type === 'cold' ? 'Cold App Start' : 'Warm App Start',
description: appStart.type === 'cold' ? 'Cold Start' : 'Warm Start',
start_timestamp: appStartTimestampSeconds,
timestamp: appStartEndTimestampSeconds,
trace_id: event.contexts.trace.trace_id,
Expand Down
36 changes: 18 additions & 18 deletions packages/core/test/tracing/integrations/appStart.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ describe('App Start Integration', () => {

const actualEvent = await captureStandAloneAppStart();

const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
const bundleStartSpan = actualEvent!.spans!.find(
({ description }) => description === 'JS Bundle Execution Start',
);

expect(appStartRootSpan).toEqual(
expect.objectContaining(<Partial<SpanJSON>>{
span_id: expect.any(String),
description: 'Cold App Start',
description: 'Cold Start',
op: APP_START_COLD_OP,
data: {
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: APP_START_COLD_OP,
Expand Down Expand Up @@ -189,15 +189,15 @@ describe('App Start Integration', () => {

const actualEvent = await captureStandAloneAppStart();

const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
const bundleStartSpan = actualEvent!.spans!.find(
({ description }) => description === 'JS Bundle Execution Before React Root',
);

expect(appStartRootSpan).toEqual(
expect.objectContaining(<Partial<SpanJSON>>{
span_id: expect.any(String),
description: 'Cold App Start',
description: 'Cold Start',
op: APP_START_COLD_OP,
data: {
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: APP_START_COLD_OP,
Expand Down Expand Up @@ -228,13 +228,13 @@ describe('App Start Integration', () => {

const actualEvent = await captureStandAloneAppStart();

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

expect(appStartRootSpan).toEqual(
expect.objectContaining(<Partial<SpanJSON>>{
span_id: expect.any(String),
description: 'Cold App Start',
description: 'Cold Start',
op: APP_START_COLD_OP,
data: {
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: APP_START_COLD_OP,
Expand Down Expand Up @@ -465,14 +465,14 @@ describe('App Start Integration', () => {

const actualEvent = await processEvent(getMinimalTransactionEvent());

const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
const bundleStartSpan = actualEvent!.spans!.find(
({ description }) => description === 'JS Bundle Execution Start',
);

expect(appStartRootSpan).toEqual(
expect.objectContaining(<Partial<SpanJSON>>{
description: 'Cold App Start',
description: 'Cold Start',
span_id: expect.any(String),
op: APP_START_COLD_OP,
origin: SPAN_ORIGIN_AUTO_APP_START,
Expand Down Expand Up @@ -505,14 +505,14 @@ describe('App Start Integration', () => {

const actualEvent = await processEvent(getMinimalTransactionEvent());

const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
const bundleStartSpan = actualEvent!.spans!.find(
({ description }) => description === 'JS Bundle Execution Before React Root',
);

expect(appStartRootSpan).toEqual(
expect.objectContaining(<Partial<SpanJSON>>{
description: 'Cold App Start',
description: 'Cold Start',
span_id: expect.any(String),
op: APP_START_COLD_OP,
origin: SPAN_ORIGIN_AUTO_APP_START,
Expand Down Expand Up @@ -545,14 +545,14 @@ describe('App Start Integration', () => {

const actualEvent = await processEvent(getMinimalTransactionEvent());

const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start');
const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start');
const bundleStartSpan = actualEvent!.spans!.find(
({ description }) => description === 'JS Bundle Execution Before React Root',
);

expect(appStartRootSpan).toEqual(
expect.objectContaining(<Partial<SpanJSON>>{
description: 'Cold App Start',
description: 'Cold Start',
span_id: expect.any(String),
op: APP_START_COLD_OP,
origin: SPAN_ORIGIN_AUTO_APP_START,
Expand Down Expand Up @@ -586,12 +586,12 @@ describe('App Start Integration', () => {

const actualEvent = await processEvent(getMinimalTransactionEvent());

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

expect(appStartRootSpan).toEqual(
expect.objectContaining(<Partial<SpanJSON>>{
description: 'Cold App Start',
description: 'Cold Start',
span_id: expect.any(String),
op: APP_START_COLD_OP,
origin: SPAN_ORIGIN_AUTO_APP_START,
Expand Down Expand Up @@ -802,7 +802,7 @@ function expectEventWithAttachedColdAppStart({
spans: expect.arrayContaining<SpanJSON>([
{
op: APP_START_COLD_OP,
description: 'Cold App Start',
description: 'Cold Start',
start_timestamp: appStartTimeMilliseconds / 1000,
timestamp: expect.any(Number),
trace_id: expect.any(String),
Expand Down Expand Up @@ -856,7 +856,7 @@ function expectEventWithAttachedWarmAppStart({
spans: expect.arrayContaining<SpanJSON>([
{
op: APP_START_WARM_OP,
description: 'Warm App Start',
description: 'Warm Start',
start_timestamp: appStartTimeMilliseconds / 1000,
timestamp: expect.any(Number),
trace_id: expect.any(String),
Expand Down Expand Up @@ -913,7 +913,7 @@ function expectEventWithStandaloneColdAppStart(
spans: expect.arrayContaining<SpanJSON>([
{
op: APP_START_COLD_OP,
description: 'Cold App Start',
description: 'Cold Start',
start_timestamp: appStartTimeMilliseconds / 1000,
timestamp: expect.any(Number),
trace_id: expect.any(String),
Expand Down Expand Up @@ -962,7 +962,7 @@ function expectEventWithStandaloneWarmAppStart(
spans: expect.arrayContaining<SpanJSON>([
{
op: APP_START_WARM_OP,
description: 'Warm App Start',
description: 'Warm Start',
start_timestamp: appStartTimeMilliseconds / 1000,
timestamp: expect.any(Number),
trace_id: expect.any(String),
Expand Down
6 changes: 3 additions & 3 deletions packages/core/test/tracing/reactnavigation.ttid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ describe('React Navigation - TTID', () => {
type: 'transaction',
spans: expect.arrayContaining([
expect.objectContaining<Partial<SpanJSON>>({
description: 'Cold App Start',
description: 'Cold Start',
}),
expect.objectContaining<Partial<SpanJSON>>({
data: {
Expand Down Expand Up @@ -289,7 +289,7 @@ describe('React Navigation - TTID', () => {
type: 'transaction',
spans: expect.arrayContaining([
expect.objectContaining<Partial<SpanJSON>>({
description: 'Cold App Start',
description: 'Cold Start',
}),
expect.objectContaining<Partial<SpanJSON>>({
data: {
Expand Down Expand Up @@ -319,7 +319,7 @@ describe('React Navigation - TTID', () => {
type: 'transaction',
spans: expect.arrayContaining([
expect.objectContaining<Partial<SpanJSON>>({
description: 'Cold App Start',
description: 'Cold Start',
}),
]),
measurements: expect.objectContaining<Required<TransactionEvent>['measurements']>({
Expand Down