Skip to content

Commit b572714

Browse files
authored
Merge branch 'main' into feat/better-logging-if-properties-file-not-loaded
2 parents 274b6df + 9e3b01d commit b572714

File tree

29 files changed

+2206
-38
lines changed

29 files changed

+2206
-38
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Removed SentryExecutorService limit for delayed scheduled tasks ([#4846](https://github.com/getsentry/sentry-java/pull/4846))
88
- Fix visual artifacts for the Canvas strategy on some devices ([#4861](https://github.com/getsentry/sentry-java/pull/4861))
9+
- Only set `DefaultReplayBreadcrumbConverter` if replay is available ([#4888](https://github.com/getsentry/sentry-java/pull/4888))
910

1011
### Improvements
1112

@@ -18,6 +19,7 @@
1819
- Bump Native SDK from v0.11.3 to v0.12.1 ([#4859](https://github.com/getsentry/sentry-java/pull/4859))
1920
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0121)
2021
- [diff](https://github.com/getsentry/sentry-native/compare/0.11.3...0.12.1)
22+
- Bump Spring Boot 4 to RC2 ([#4886](https://github.com/getsentry/sentry-java/pull/4886))
2123

2224
## 8.25.0
2325

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ retrofit = "2.9.0"
3131
slf4j = "1.7.30"
3232
springboot2 = "2.7.18"
3333
springboot3 = "3.5.0"
34-
springboot4 = "4.0.0-RC1"
34+
springboot4 = "4.0.0-RC2"
3535
# Android
3636
targetSdk = "34"
3737
compileSdk = "34"

sentry-android-core/src/main/java/io/sentry/android/core/AndroidOptionsInitializer.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import io.sentry.NoOpCompositePerformanceCollector;
1717
import io.sentry.NoOpConnectionStatusProvider;
1818
import io.sentry.NoOpContinuousProfiler;
19+
import io.sentry.NoOpReplayBreadcrumbConverter;
1920
import io.sentry.NoOpSocketTagger;
2021
import io.sentry.NoOpTransactionProfiler;
2122
import io.sentry.NoopVersionDetector;
@@ -145,21 +146,24 @@ static void initializeIntegrationsAndProcessors(
145146
final @NotNull SentryAndroidOptions options,
146147
final @NotNull Context context,
147148
final @NotNull io.sentry.util.LoadClass loadClass,
148-
final @NotNull ActivityFramesTracker activityFramesTracker) {
149+
final @NotNull ActivityFramesTracker activityFramesTracker,
150+
final boolean isReplayAvailable) {
149151
initializeIntegrationsAndProcessors(
150152
options,
151153
context,
152154
new BuildInfoProvider(new AndroidLogger()),
153155
loadClass,
154-
activityFramesTracker);
156+
activityFramesTracker,
157+
isReplayAvailable);
155158
}
156159

157160
static void initializeIntegrationsAndProcessors(
158161
final @NotNull SentryAndroidOptions options,
159162
final @NotNull Context context,
160163
final @NotNull BuildInfoProvider buildInfoProvider,
161164
final @NotNull io.sentry.util.LoadClass loadClass,
162-
final @NotNull ActivityFramesTracker activityFramesTracker) {
165+
final @NotNull ActivityFramesTracker activityFramesTracker,
166+
final boolean isReplayAvailable) {
163167

164168
if (options.getCacheDirPath() != null
165169
&& options.getEnvelopeDiskCache() instanceof NoOpEnvelopeCache) {
@@ -253,6 +257,14 @@ static void initializeIntegrationsAndProcessors(
253257
options.setCompositePerformanceCollector(new DefaultCompositePerformanceCollector(options));
254258
}
255259

260+
if (isReplayAvailable
261+
&& options.getReplayController().getBreadcrumbConverter()
262+
instanceof NoOpReplayBreadcrumbConverter) {
263+
options
264+
.getReplayController()
265+
.setBreadcrumbConverter(new DefaultReplayBreadcrumbConverter(options));
266+
}
267+
256268
// Check if the profiler was already instantiated in the app start.
257269
// We use the Android profiler, that uses a global start/stop api, so we need to preserve the
258270
// state of the profiler, and it's only possible retaining the instance.
@@ -406,7 +418,6 @@ static void installDefaultIntegrations(
406418
if (isReplayAvailable) {
407419
final ReplayIntegration replay =
408420
new ReplayIntegration(context, CurrentDateProvider.getInstance());
409-
replay.setBreadcrumbConverter(new DefaultReplayBreadcrumbConverter());
410421
options.addIntegration(replay);
411422
options.setReplayController(replay);
412423
}

sentry-android-core/src/main/java/io/sentry/android/core/SentryAndroid.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,12 @@ public static void init(
171171
}
172172

173173
AndroidOptionsInitializer.initializeIntegrationsAndProcessors(
174-
options, context, buildInfoProvider, loadClass, activityFramesTracker);
174+
options,
175+
context,
176+
buildInfoProvider,
177+
loadClass,
178+
activityFramesTracker,
179+
isReplayAvailable);
175180

176181
deduplicateIntegrations(options, isFragmentAvailable, isTimberAvailable);
177182
},

sentry-android-core/src/test/java/io/sentry/android/core/AndroidContinuousProfilerTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ class AndroidContinuousProfilerTest {
134134
buildInfoProvider,
135135
loadClass,
136136
activityFramesTracker,
137+
false,
137138
)
138139
// Profiler doesn't start if the folder doesn't exists.
139140
// Usually it's generated when calling Sentry.init, but for tests we can create it manually.

sentry-android-core/src/test/java/io/sentry/android/core/AndroidOptionsInitializerTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class AndroidOptionsInitializerTest {
117117
if (useRealContext) context else mockContext,
118118
loadClass,
119119
activityFramesTracker,
120+
false,
120121
)
121122
}
122123

@@ -162,6 +163,7 @@ class AndroidOptionsInitializerTest {
162163
buildInfo,
163164
loadClass,
164165
activityFramesTracker,
166+
isReplayAvailable,
165167
)
166168
}
167169

sentry-android-core/src/test/java/io/sentry/android/core/AndroidProfilerTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class AndroidProfilerTest {
136136
buildInfoProvider,
137137
loadClass,
138138
activityFramesTracker,
139+
false,
139140
)
140141
// Profiler doesn't start if the folder doesn't exists.
141142
// Usually it's generated when calling Sentry.init, but for tests we can create it manually.

sentry-android-core/src/test/java/io/sentry/android/core/AndroidTransactionProfilerTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ class AndroidTransactionProfilerTest {
152152
buildInfoProvider,
153153
loadClass,
154154
activityFramesTracker,
155+
false,
155156
)
156157
// Profiler doesn't start if the folder doesn't exists.
157158
// Usually it's generated when calling Sentry.init, but for tests we can create it manually.

sentry-android-core/src/test/java/io/sentry/android/core/SentryInitProviderTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ class SentryInitProviderTest {
168168
mockContext,
169169
loadClass,
170170
activityFramesTracker,
171+
false,
171172
)
172173

173174
assertFalse(sentryOptions.isEnableNdk)

sentry-android-replay/api/sentry-android-replay.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public final class io/sentry/android/replay/BuildConfig {
99
public class io/sentry/android/replay/DefaultReplayBreadcrumbConverter : io/sentry/ReplayBreadcrumbConverter {
1010
public static final field $stable I
1111
public fun <init> ()V
12+
public fun <init> (Lio/sentry/SentryOptions;)V
1213
public fun convert (Lio/sentry/Breadcrumb;)Lio/sentry/rrweb/RRWebEvent;
1314
}
1415

0 commit comments

Comments
 (0)