Skip to content

Commit 3eb7ad1

Browse files
committed
ref(crashpad): pass predefined report ID (#1488)
1 parent 08b1374 commit 3eb7ad1

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/backends/sentry_backend_crashpad.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ crashpad_backend_startup(
539539

540540
std::vector<std::string> arguments { "--no-rate-limit" };
541541

542+
char report_id[37];
543+
sentry_uuid_as_string(&data->crash_event_id, report_id);
544+
542545
// Initialize database first, flushing the consent later on as part of
543546
// `sentry_init` will persist the upload flag.
544547
data->db = crashpad::CrashReportDatabase::Initialize(database).release();
@@ -564,7 +567,8 @@ crashpad_backend_startup(
564567
minidump_url ? minidump_url : "", proxy_url, annotations, arguments,
565568
/* restartable */ true,
566569
/* asynchronous_start */ false, attachments, screenshot,
567-
options->crashpad_wait_for_upload, crash_reporter, crash_envelope);
570+
options->crashpad_wait_for_upload, crash_reporter, crash_envelope,
571+
report_id);
568572
sentry_free(minidump_url);
569573

570574
#ifdef SENTRY_PLATFORM_WINDOWS

tests/assertions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ def assert_crashpad_upload(req, expect_attachment=False, expect_view_hierarchy=F
475475
and b"\n\nMDMP" in part.as_bytes()
476476
for part in msg.walk()
477477
)
478+
return attachments
478479

479480

480481
def assert_gzip_file_header(output):

tests/test_integration_crashpad.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,14 @@ def test_crashpad_dumping_crash(cmake, httpserver, run_args, build_args):
410410

411411
envelope = Envelope.deserialize(session)
412412
assert_session(envelope, {"status": "crashed", "errors": 1})
413-
assert_crashpad_upload(
413+
attachments = assert_crashpad_upload(
414414
multipart,
415415
expect_attachment="clear-attachments" not in run_args,
416416
expect_view_hierarchy="clear-attachments" not in run_args,
417417
)
418+
event_id = attachments.event["event_id"]
419+
minidump = tmp_path / ".sentry-native" / "completed" / f"{event_id}.dmp"
420+
assert minidump.exists()
418421

419422

420423
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)