Skip to content

Commit a803296

Browse files
authored
Merge branch 'main' into lcian/fix/cowal-iterator
2 parents 04c2e16 + 0b8cee0 commit a803296

File tree

203 files changed

+4476
-3560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+4476
-3560
lines changed

.github/workflows/system-tests-backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
102102
- name: Start server and run integration test for sentry-cli commands
103103
run: |
104-
test/system-test-run.sh "${{ matrix.sample }}" "${{ matrix.agent }}" "${{ matrix.agent-auto-init }}"
104+
test/system-test-run.sh "${{ matrix.sample }}" "${{ matrix.agent }}" "${{ matrix.agent-auto-init }}" "0"
105105
106106
- name: Upload test results
107107
if: always()

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ distributions/
2020
sentry-spring-boot-starter-jakarta/src/main/resources/META-INF/spring.factories
2121
sentry-samples/sentry-samples-spring-boot-jakarta/spy.log
2222
spy.log
23+
buildSrc/.kotlin/

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,44 @@
44

55
### Fixes
66

7+
- The SDK now handles `null` on many APIs instead of expecting a non `null` value ([#4245](https://github.com/getsentry/sentry-java/pull/4245))
8+
- Certain APIs like `setTag`, `setData`, `setExtra`, `setContext` previously caused a `NullPointerException` when invoked with either `null` key or value.
9+
- The SDK now tries to have a sane fallback when `null` is passed and no longer throws `NullPointerException`
10+
- If `null` is passed, the SDK will
11+
- do nothing if a `null` key is passed, returning `null` for non void methods
12+
- remove any previous value if the new value is set to `null`
713
- Add support for setting in-app-includes/in-app-excludes via AndroidManifest.xml ([#4240](https://github.com/getsentry/sentry-java/pull/4240))
14+
- Modifications to OkHttp requests are now properly propagated to the affected span / breadcrumbs ([#4238](https://github.com/getsentry/sentry-java/pull/4238))
15+
- Please ensure the SentryOkHttpInterceptor is added last to your OkHttpClient, as otherwise changes to the `Request` by subsequent interceptors won't be considered
16+
- Fix "class ch.qos.logback.classic.spi.ThrowableProxyVO cannot be cast to class ch.qos.logback.classic.spi.ThrowableProxy" ([#4206](https://github.com/getsentry/sentry-java/pull/4206))
17+
- In this case we cannot report the `Throwable` to Sentry as it's not available
18+
- If you are using OpenTelemetry v1 `OpenTelemetryAppender`, please consider upgrading to v2
19+
- Pass OpenTelemetry span attributes into TracesSampler callback ([#4253](https://github.com/getsentry/sentry-java/pull/4253))
20+
- `SamplingContext` now has a `getAttribute` method that grants access to OpenTelemetry span attributes via their String key (e.g. `http.request.method`)
21+
- Fix AbstractMethodError when using SentryTraced for Jetpack Compose ([#4255](https://github.com/getsentry/sentry-java/pull/4255))
822
- Avoid unnecessary copies when using `CopyOnWriteArrayList` ([#4247](https://github.com/getsentry/sentry-java/pull/4247))
923
- This affects in particular `SentryTracer.getLatestActiveSpan` which would have previously unnecessarily copied all children spans, with high impact on memory usage
1024

1125
### Features
1226

1327
- The SDK now automatically propagates the trace-context to the native layer. This allows to connect errors on different layers of the application. ([#4137](https://github.com/getsentry/sentry-java/pull/4137))
28+
- Capture OpenTelemetry span events ([#3564](https://github.com/getsentry/sentry-java/pull/3564))
29+
- OpenTelemetry spans may have exceptions attached to them (`openTelemetrySpan.recordException`). We can now send those to Sentry as errors.
30+
- Set `capture-open-telemetry-events=true` in `sentry.properties` to enable it
31+
- Set `sentry.capture-open-telemetry-events=true` in Springs `application.properties` to enable it
32+
- Set `sentry.captureOpenTelemetryEvents: true` in Springs `application.yml` to enable it
1433

1534
### Behavioural Changes
1635

1736
- Use `java.net.URI` for parsing URLs in `UrlUtils` ([#4210](https://github.com/getsentry/sentry-java/pull/4210))
1837
- This could affect grouping for issues with messages containing URLs that fall in known corner cases that were handled incorrectly previously (e.g. email in URL path)
1938

39+
### Internal
40+
41+
- Also use port when checking if a request is made to Sentry DSN ([#4231](https://github.com/getsentry/sentry-java/pull/4231))
42+
- For our OpenTelemetry integration we check if a span is for a request to Sentry
43+
- We now also consider the port when performing this check
44+
2045
### Dependencies
2146

2247
- Bump Native SDK from v0.7.20 to v0.8.1 ([#4137](https://github.com/getsentry/sentry-java/pull/4137))
@@ -459,6 +484,24 @@ If you have been using `8.0.0-rc.4` of the Java SDK, here's the new changes that
459484
- We are planning to improve this in the future but opted for this fix first.
460485
- Fix swallow NDK loadLibrary errors ([#4082](https://github.com/getsentry/sentry-java/pull/4082))
461486

487+
## 7.22.1
488+
489+
### Fixes
490+
491+
- Fix Ensure app start type is set, even when ActivityLifecycleIntegration is not running ([#4216](https://github.com/getsentry/sentry-java/pull/4216))
492+
- Fix properly reset application/content-provider timespans for warm app starts ([#4244](https://github.com/getsentry/sentry-java/pull/4244))
493+
494+
## 7.22.0
495+
496+
### Fixes
497+
498+
- Session Replay: Fix various crashes and issues ([#4135](https://github.com/getsentry/sentry-java/pull/4135))
499+
- Fix `FileNotFoundException` when trying to read/write `.ongoing_segment` file
500+
- Fix `IllegalStateException` when registering `onDrawListener`
501+
- Fix SIGABRT native crashes on Motorola devices when encoding a video
502+
- (Jetpack Compose) Modifier.sentryTag now uses Modifier.Node ([#4029](https://github.com/getsentry/sentry-java/pull/4029))
503+
- This allows Composables that use this modifier to be skippable
504+
462505
## 7.21.0
463506

464507
### Fixes

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ subprojects {
155155
}
156156
}
157157

158-
if (!this.name.contains("sample") && !this.name.contains("integration-tests") && this.name != "sentry-test-support" && this.name != "sentry-compose-helper") {
158+
if (!this.name.contains("sample") && !this.name.contains("integration-tests") && this.name != "sentry-system-test-support" && this.name != "sentry-test-support" && this.name != "sentry-compose-helper") {
159159
apply<DistributionPlugin>()
160160
apply<com.vanniktech.maven.publish.MavenPublishPlugin>()
161161

buildSrc/src/main/java/Config.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,14 @@ object Config {
6969
val slf4jJdk14 = "org.slf4j:slf4j-jdk14:1.7.30"
7070
val logbackVersion = "1.2.9"
7171
val logbackClassic = "ch.qos.logback:logback-classic:$logbackVersion"
72+
val logbackCore = "ch.qos.logback:logback-core:$logbackVersion"
7273

7374
val log4j2Version = "2.20.0"
7475
val log4j2Api = "org.apache.logging.log4j:log4j-api:$log4j2Version"
7576
val log4j2Core = "org.apache.logging.log4j:log4j-core:$log4j2Version"
7677

77-
val jacksonDatabind = "com.fasterxml.jackson.core:jackson-databind"
78+
val jacksonDatabind = "com.fasterxml.jackson.core:jackson-databind:2.18.3"
79+
val jacksonKotlin = "com.fasterxml.jackson.module:jackson-module-kotlin:2.18.3"
7880

7981
val springBootStarter = "org.springframework.boot:spring-boot-starter:$springBootVersion"
8082
val springBootStarterGraphql = "org.springframework.boot:spring-boot-starter-graphql:$springBootVersion"

codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ coverage:
1616
ignore:
1717
- "**/src/test/*"
1818
- "sentry-android-integration-tests/*"
19+
- "sentry-system-test-support/*"
1920
- "sentry-test-support/*"
2021
- "sentry-samples/*"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ class InternalSentrySdkTest {
319319
fun `serializeScope provides fallback app data if none is set`() {
320320
val options = SentryAndroidOptions()
321321
val scope = Scope(options)
322-
scope.setContexts("app", null)
322+
scope.setContexts("app", null as Any?)
323323

324324
val serializedScope = InternalSentrySdk.serializeScope(context, options, scope)
325325
assertTrue(((serializedScope["contexts"] as Map<*, *>)["app"] as Map<*, *>).containsKey("app_name"))

sentry-compose/src/androidMain/kotlin/io/sentry/compose/SentryModifier.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ public object SentryModifier {
5151
Modifier.Node(),
5252
SemanticsModifierNode {
5353

54+
override val shouldClearDescendantSemantics: Boolean
55+
get() = false
56+
57+
override val shouldMergeDescendantSemantics: Boolean
58+
get() = false
59+
5460
override fun SemanticsPropertyReceiver.applySemantics() {
5561
this[SentryTag] = tag
5662
}

sentry-logback/src/main/java/io/sentry/logback/SentryAppender.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,16 @@ protected void append(@NotNull ILoggingEvent eventObject) {
110110
event.setLogger(loggingEvent.getLoggerName());
111111
event.setLevel(formatLevel(loggingEvent.getLevel()));
112112

113-
final ThrowableProxy throwableInformation = (ThrowableProxy) loggingEvent.getThrowableProxy();
114-
if (throwableInformation != null) {
115-
final Mechanism mechanism = new Mechanism();
116-
mechanism.setType(MECHANISM_TYPE);
117-
final Throwable mechanismException =
118-
new ExceptionMechanismException(
119-
mechanism, throwableInformation.getThrowable(), Thread.currentThread());
120-
event.setThrowable(mechanismException);
113+
if (loggingEvent.getThrowableProxy() instanceof ThrowableProxy) {
114+
final ThrowableProxy throwableInformation = (ThrowableProxy) loggingEvent.getThrowableProxy();
115+
if (throwableInformation != null) {
116+
final Mechanism mechanism = new Mechanism();
117+
mechanism.setType(MECHANISM_TYPE);
118+
final Throwable mechanismException =
119+
new ExceptionMechanismException(
120+
mechanism, throwableInformation.getThrowable(), Thread.currentThread());
121+
event.setThrowable(mechanismException);
122+
}
121123
}
122124

123125
if (loggingEvent.getThreadName() != null) {

sentry-logback/src/test/kotlin/io/sentry/logback/SentryAppenderTest.kt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import ch.qos.logback.classic.Level
44
import ch.qos.logback.classic.LoggerContext
55
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
66
import ch.qos.logback.classic.spi.ILoggingEvent
7+
import ch.qos.logback.classic.spi.LoggingEvent
8+
import ch.qos.logback.classic.spi.LoggingEventVO
9+
import ch.qos.logback.classic.spi.ThrowableProxy
710
import ch.qos.logback.core.encoder.Encoder
811
import ch.qos.logback.core.encoder.EncoderBase
912
import ch.qos.logback.core.status.Status
@@ -536,4 +539,24 @@ class SentryAppenderTest {
536539
assertTrue(Sentry.isEnabled())
537540
System.clearProperty("sentry.dsn")
538541
}
542+
543+
@Test
544+
fun `does not crash on ThrowableProxyVO`() {
545+
fixture = Fixture()
546+
val throwableProxy = ThrowableProxy(RuntimeException("hello proxy throwable"))
547+
val loggingEvent = LoggingEvent()
548+
loggingEvent.level = Level.ERROR
549+
loggingEvent.setThrowableProxy(throwableProxy)
550+
val loggingEventVO = LoggingEventVO.build(loggingEvent)
551+
552+
fixture.appender.append(loggingEventVO)
553+
554+
verify(fixture.transport).send(
555+
checkEvent { event ->
556+
assertEquals(SentryLevel.ERROR, event.level)
557+
assertNull(event.exceptions)
558+
},
559+
anyOrNull()
560+
)
561+
}
539562
}

0 commit comments

Comments
 (0)