Skip to content
Draft
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- If you use a narrow string path interface (for instance, `sentry_options_set_database_path()`) on _Windows_ rather than one of the wide string variants (`sentry_options_set_database_pathw()`), then the expected encoding is now UTF-8. ([#1413](https://github.com/getsentry/sentry-native/pull/1413))

**Features**:

- Support modifying attachments after `sentry_init` on macOS. ([#1429](https://github.com/getsentry/sentry-native/pull/1429))

**Fixes**:

- Add logs flush on crash. This is not available for macOS with the `crashpad` backend. ([#1404](https://github.com/getsentry/sentry-native/pull/1404))
Expand Down
3 changes: 0 additions & 3 deletions include/sentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
* attachment paths will be resolved according to the current working directory
* at the time of envelope creation. When adding and removing attachments, they
* are matched according to their given `path`. No normalization is performed.
* When using the `crashpad` backend on macOS, the list of attachments that will
* be added at the time of a hard crash will be frozen at the time of
* `sentry_init`, and later modifications will not be reflected.
*/

#ifndef SENTRY_H_INCLUDED
Expand Down
6 changes: 4 additions & 2 deletions src/backends/sentry_backend_crashpad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,8 @@ crashpad_backend_prune_database(sentry_backend_t *backend)
crashpad::PruneCrashReportDatabase(data->db, &condition);
}

#if defined(SENTRY_PLATFORM_WINDOWS) || defined(SENTRY_PLATFORM_LINUX)
#if defined(SENTRY_PLATFORM_WINDOWS) || defined(SENTRY_PLATFORM_LINUX) \
|| defined(SENTRY_PLATFORM_MACOS)
static bool
ensure_unique_path(sentry_attachment_t *attachment)
{
Expand Down Expand Up @@ -835,7 +836,8 @@ sentry__backend_new(void)
backend->user_consent_changed_func = crashpad_backend_user_consent_changed;
backend->get_last_crash_func = crashpad_backend_last_crash;
backend->prune_database_func = crashpad_backend_prune_database;
#if defined(SENTRY_PLATFORM_WINDOWS) || defined(SENTRY_PLATFORM_LINUX)
#if defined(SENTRY_PLATFORM_WINDOWS) || defined(SENTRY_PLATFORM_LINUX) \
|| defined(SENTRY_PLATFORM_MACOS)
backend->add_attachment_func = crashpad_backend_add_attachment;
backend->remove_attachment_func = crashpad_backend_remove_attachment;
#endif
Expand Down
4 changes: 1 addition & 3 deletions tests/assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,9 @@ def assert_crashpad_upload(req, expect_attachment=False, expect_view_hierarchy=F
assert_event_meta(attachments.event, integration="crashpad")
if expect_attachment:
assert attachments.cmake_cache > 0
else:
assert attachments.cmake_cache == -1
if expect_attachment and (sys.platform == "win32" or sys.platform == "linux"):
assert attachments.bytes_bin == b"\xc0\xff\xee"
else:
assert attachments.cmake_cache == -1
assert attachments.bytes_bin == None
if expect_view_hierarchy:
assert_attachment_content_view_hierarchy(attachments.view_hierarchy)
Expand Down
8 changes: 0 additions & 8 deletions tests/test_integration_crashpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,18 +352,10 @@ def test_crashpad_wer_crash(cmake, httpserver, run_args):
pytest.param(
["attach-after-init"],
{},
marks=pytest.mark.skipif(
sys.platform == "darwin",
reason="crashpad doesn't support dynamic attachments on macOS",
),
),
pytest.param(
["attachment", "attach-after-init", "clear-attachments"],
{},
marks=pytest.mark.skipif(
sys.platform == "darwin",
reason="crashpad doesn't support dynamic attachments on macOS",
),
),
],
)
Expand Down
Loading