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 @@ -12,6 +12,7 @@

- native: Fix crash daemon failing to detect crashes during OOM on Windows. ([#1603](https://github.com/getsentry/sentry-native/issues/1603))
- Fix `WinHttpReceiveResponse` failures being silently ignored, which could cause envelopes to be lost instead of retried or cached. ([#1620](https://github.com/getsentry/sentry-native/pull/1620))
- Fix missing screenshot attachment in native backend envelope ([#1624](https://github.com/getsentry/sentry-native/pull/1624))

## 0.13.4

Expand Down
22 changes: 22 additions & 0 deletions src/backends/native/sentry_crash_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,17 @@ write_envelope_with_native_stacktrace(const sentry_options_t *options,
}
}

// Add screenshot attachment if captured by the daemon
if (options && options->attach_screenshot && run_folder) {
sentry_path_t *screenshot_path
= sentry__path_join_str(run_folder, "screenshot.png");
if (screenshot_path) {
write_attachment_to_envelope(
fd, screenshot_path->path, "screenshot.png", "image/png");
sentry__path_free(screenshot_path);
}
}

#if defined(SENTRY_PLATFORM_UNIX)
close(fd);
#elif defined(SENTRY_PLATFORM_WINDOWS)
Expand Down Expand Up @@ -2614,6 +2625,17 @@ write_envelope_with_minidump(const sentry_options_t *options,
}
}

// Add screenshot attachment if captured by the daemon
if (options && options->attach_screenshot && run_folder) {
sentry_path_t *screenshot_path
= sentry__path_join_str(run_folder, "screenshot.png");
if (screenshot_path) {
write_attachment_to_envelope(
fd, screenshot_path->path, "screenshot.png", "image/png");
sentry__path_free(screenshot_path);
}
}

#if defined(SENTRY_PLATFORM_UNIX)
close(fd);
#elif defined(SENTRY_PLATFORM_WINDOWS)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_integration_screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def assert_screenshot_upload(req):
pytest.param(
{"SENTRY_BACKEND": "native"},
marks=pytest.mark.skip(
reason="Native backend screenshot needs testing on Windows machine"
reason="Native daemon cleans up run folder after processing "
"so the screenshot file is no longer on disk"
),
),
],
Expand Down
Loading