Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
**Fixes**:

- Report on partial disk writes when streaming envelopes to file, which previously left truncated envelopes on disk and reported success. ([#1804](https://github.com/getsentry/sentry-native/pull/1804))
- Android: breadcrumb `data` is now sent as a structured object instead of a raw JSON string. ([#1808](https://github.com/getsentry/sentry-native/pull/1808))

## 0.15.0

Expand Down
12 changes: 11 additions & 1 deletion ndk/lib/src/androidTest/java/io/sentry/ndk/SentryNdkTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.sentry.ndk;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -109,7 +110,12 @@ public void messageCaught() throws IOException {
// when initialized
SentryNdk.init(options);

// and a message is captured
// and a breadcrumb whose data was serialized to a JSON object string is added
new NativeScope()
.addBreadcrumb(
"info", "test crumb", "test", "default", null, "{\"some_key\":\"some_value\"}");

// and a message is captured (which merges the scope's breadcrumbs into it)
NdkTestHelper.message();

// then the message should be stored on disk
Expand All @@ -120,6 +126,10 @@ public void messageCaught() throws IOException {
String content = new String(Files.readAllBytes(firstFile.toPath()), StandardCharsets.UTF_8);
assertTrue(content.contains("It works!")); // expected message content from
// Java_io_sentry_ndk_NdkTestHelper_message(..) in ndk-test.cpp

// and the breadcrumb data is well formed.
assertTrue(content.contains("\"some_key\":\"some_value\""));
assertFalse(content.contains("\"data\":\"{"));
}

@Test
Expand Down
Loading
Loading