Skip to content

Commit a52cb2d

Browse files
authored
Merge branch 'main' into dependabot/github_actions/reactivecircus/android-emulator-runner-2.35.0
2 parents 70258cf + dcc6bbf commit a52cb2d

File tree

11 files changed

+49
-10
lines changed

11 files changed

+49
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@
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+
- [Config] Trim whitespace on properties path ([#4880](https://github.com/getsentry/sentry-java/pull/4880))
10+
- Only set `DefaultReplayBreadcrumbConverter` if replay is available ([#4888](https://github.com/getsentry/sentry-java/pull/4888))
911

1012
### Improvements
1113

1214
- Fallback to distinct-id as user.id logging attribute when user is not set ([#4847](https://github.com/getsentry/sentry-java/pull/4847))
1315
- Report Timber.tag() as `timber.tag` log attribute ([#4845](https://github.com/getsentry/sentry-java/pull/4845))
1416
- Session Replay: Add screenshot strategy serialization to RRWeb events ([#4851](https://github.com/getsentry/sentry-java/pull/4851))
17+
- Log why a properties file was not loaded ([#4879](https://github.com/getsentry/sentry-java/pull/4879))
1518

1619
### Dependencies
1720

1821
- Bump Native SDK from v0.11.3 to v0.12.1 ([#4859](https://github.com/getsentry/sentry-java/pull/4859))
1922
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0121)
2023
- [diff](https://github.com/getsentry/sentry-native/compare/0.11.3...0.12.1)
24+
- Bump Spring Boot 4 to RC2 ([#4886](https://github.com/getsentry/sentry-java/pull/4886))
2125

2226
## 8.25.0
2327

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: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,24 @@ static void initializeIntegrationsAndProcessors(
146146
final @NotNull SentryAndroidOptions options,
147147
final @NotNull Context context,
148148
final @NotNull io.sentry.util.LoadClass loadClass,
149-
final @NotNull ActivityFramesTracker activityFramesTracker) {
149+
final @NotNull ActivityFramesTracker activityFramesTracker,
150+
final boolean isReplayAvailable) {
150151
initializeIntegrationsAndProcessors(
151152
options,
152153
context,
153154
new BuildInfoProvider(new AndroidLogger()),
154155
loadClass,
155-
activityFramesTracker);
156+
activityFramesTracker,
157+
isReplayAvailable);
156158
}
157159

158160
static void initializeIntegrationsAndProcessors(
159161
final @NotNull SentryAndroidOptions options,
160162
final @NotNull Context context,
161163
final @NotNull BuildInfoProvider buildInfoProvider,
162164
final @NotNull io.sentry.util.LoadClass loadClass,
163-
final @NotNull ActivityFramesTracker activityFramesTracker) {
165+
final @NotNull ActivityFramesTracker activityFramesTracker,
166+
final boolean isReplayAvailable) {
164167

165168
if (options.getCacheDirPath() != null
166169
&& options.getEnvelopeDiskCache() instanceof NoOpEnvelopeCache) {
@@ -254,8 +257,9 @@ static void initializeIntegrationsAndProcessors(
254257
options.setCompositePerformanceCollector(new DefaultCompositePerformanceCollector(options));
255258
}
256259

257-
if (options.getReplayController().getBreadcrumbConverter()
258-
instanceof NoOpReplayBreadcrumbConverter) {
260+
if (isReplayAvailable
261+
&& options.getReplayController().getBreadcrumbConverter()
262+
instanceof NoOpReplayBreadcrumbConverter) {
259263
options
260264
.getReplayController()
261265
.setBreadcrumbConverter(new DefaultReplayBreadcrumbConverter(options));

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/src/main/java/io/sentry/config/FilesystemPropertiesLoader.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import java.io.BufferedInputStream;
66
import java.io.File;
77
import java.io.FileInputStream;
8-
import java.io.IOException;
98
import java.io.InputStream;
109
import java.util.Properties;
1110
import org.jetbrains.annotations.NotNull;
@@ -24,15 +23,25 @@ public FilesystemPropertiesLoader(@NotNull String filePath, @NotNull ILogger log
2423
@Override
2524
public @Nullable Properties load() {
2625
try {
27-
final File f = new File(filePath);
26+
final File f = new File(filePath.trim());
2827
if (f.isFile() && f.canRead()) {
2928
try (InputStream is = new BufferedInputStream(new FileInputStream(f))) {
3029
final Properties properties = new Properties();
3130
properties.load(is);
3231
return properties;
3332
}
33+
} else if (!f.isFile()) {
34+
logger.log(
35+
SentryLevel.ERROR,
36+
"Failed to load Sentry configuration since it is not a file or does not exist: %s",
37+
filePath);
38+
} else if (!f.canRead()) {
39+
logger.log(
40+
SentryLevel.ERROR,
41+
"Failed to load Sentry configuration since it is not readable: %s",
42+
filePath);
3443
}
35-
} catch (IOException e) {
44+
} catch (Throwable e) {
3645
logger.log(
3746
SentryLevel.ERROR, e, "Failed to load Sentry configuration from file: %s", filePath);
3847
return null;

0 commit comments

Comments
 (0)