Skip to content

Commit 4620134

Browse files
Fix setting in-app-includes from external properties. (#1291)
1 parent 8324e22 commit 4620134

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# vNext
22

3+
* Fix: Fix setting in-app-includes from external properties (#1291)
4+
35

46
# 4.2.0
57

sentry/src/main/java/io/sentry/SentryOptions.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,14 @@ void merge(final @NotNull SentryOptions options) {
13831383
for (final Map.Entry<String, String> tag : tags.entrySet()) {
13841384
this.tags.put(tag.getKey(), tag.getValue());
13851385
}
1386+
final List<String> inAppIncludes = new ArrayList<>(options.getInAppIncludes());
1387+
for (final String inAppInclude : inAppIncludes) {
1388+
addInAppInclude(inAppInclude);
1389+
}
1390+
final List<String> inAppExcludes = new ArrayList<>(options.getInAppExcludes());
1391+
for (final String inAppExclude : inAppExcludes) {
1392+
addInAppExclude(inAppExclude);
1393+
}
13861394
}
13871395

13881396
private @NotNull SdkVersion createSdkVersion() {

sentry/src/test/java/io/sentry/SentryOptionsTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ class SentryOptionsTest {
177177
externalOptions.setTag("tag2", "value2")
178178
externalOptions.enableUncaughtExceptionHandler = false
179179
externalOptions.tracesSampleRate = 0.5
180+
externalOptions.addInAppInclude("com.app")
181+
externalOptions.addInAppExclude("io.off")
180182
val options = SentryOptions()
181183

182184
options.merge(externalOptions)
@@ -192,6 +194,8 @@ class SentryOptionsTest {
192194
assertEquals(mapOf("tag1" to "value1", "tag2" to "value2"), options.tags)
193195
assertFalse(options.enableUncaughtExceptionHandler!!)
194196
assertEquals(0.5, options.tracesSampleRate)
197+
assertEquals(listOf("com.app"), options.inAppIncludes)
198+
assertEquals(listOf("io.off"), options.inAppExcludes)
195199
}
196200

197201
@Test

0 commit comments

Comments
 (0)