Skip to content

feat(native): capture WER report ID to crash events - #1970

Open
jpnurmi wants to merge 9 commits into
masterfrom
jpnurmi/feat/wer-report-id
Open

feat(native): capture WER report ID to crash events#1970
jpnurmi wants to merge 9 commits into
masterfrom
jpnurmi/feat/wer-report-id

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Capture WER report ID into the shared memory, and expose it as contexts.wer.report_id in crash events.

image

https://sentry-sdks.sentry.io/issues/7663645167

(.venv) C:\Users\jpnurmi\Projects\sentry\sentry-native>pytest -v --with_wer tests\test_integration_wer.py
=================================================================== test session starts ====================================================================
platform win32 -- Python 3.13.3, pytest-9.0.3, pluggy-1.6.0 -- C:\Users\jpnurmi\Projects\sentry\sentry-native\.venv\Scripts\python.exe
cachedir: .pytest_cache
rootdir: C:\Users\jpnurmi\Projects\sentry\sentry-native
plugins: flaky-3.8.1, pytest_httpserver-1.0.10, xdist-3.8.0
collected 15 items

tests/test_integration_wer.py::test_wer_custom_metadata[none] PASSED                                                                                  [  6%]
tests/test_integration_wer.py::test_wer_custom_metadata[inproc] PASSED                                                                                [ 13%]
tests/test_integration_wer.py::test_wer_custom_metadata[breakpad] XFAIL (breakpad swallows SEH exceptions)                                            [ 20%]
tests/test_integration_wer.py::test_wer_custom_metadata[crashpad] XFAIL (crashpad terminates the process)                                             [ 26%]
tests/test_integration_wer.py::test_wer_custom_metadata[native] PASSED                                                                                [ 33%]
tests/test_integration_wer.py::test_wer_compatibility[inproc-crash] PASSED                                                                            [ 40%]
tests/test_integration_wer.py::test_wer_compatibility[inproc-fastfail] XFAIL (inproc does not capture WER exceptions)                                 [ 46%]
tests/test_integration_wer.py::test_wer_compatibility[breakpad-crash] XFAIL (breakpad swallows SEH exceptions)                                        [ 53%]
tests/test_integration_wer.py::test_wer_compatibility[breakpad-fastfail] XFAIL (breakpad does not capture WER exceptions)                             [ 60%]
tests/test_integration_wer.py::test_wer_compatibility[crashpad-crash] XFAIL (crashpad terminates the process)                                         [ 66%]
tests/test_integration_wer.py::test_wer_compatibility[crashpad-fastfail] XFAIL (crashpad terminates the process)                                      [ 73%]
tests/test_integration_wer.py::test_wer_compatibility[native-crash] PASSED                                                                            [ 80%]
tests/test_integration_wer.py::test_wer_compatibility[native-fastfail] PASSED                                                                         [ 86%]
tests/test_integration_wer.py::test_wer_appx[crash] PASSED                                                                                            [ 93%]
tests/test_integration_wer.py::test_wer_appx[fastfail] PASSED                                                                                         [100%]

========================================================= 8 passed, 7 xfailed in 240.94s (0:04:00) =========================================================

See also:

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 93553a5

Comment thread src/backends/native/sentry_wer.c
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.13%. Comparing base (a12dd91) to head (93553a5).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1970      +/-   ##
==========================================
- Coverage   76.15%   76.13%   -0.03%     
==========================================
  Files          94       94              
  Lines       22216    22231      +15     
  Branches     3941     3944       +3     
==========================================
+ Hits        16919    16925       +6     
- Misses       4411     4420       +9     
  Partials      886      886              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Capture WER report ID into the shared memory, and expose it as
`contexts.wer.report_id` in crash events.
Regular SEH crashes kept the crashing process alive until the daemon had
already serialized the event. Windows invokes the WER callback only after
the exception filter returns, so the callback could not publish its report
ID to shared memory in time.

Add an intermediate PROCESSED state so the daemon can finish reading
process-dependent crash data, release the SEH handler, and then wait for
the WER callback before serializing the event. Record whether WER was
registered to avoid waiting when no callback can arrive, and retain the
existing timeout as a fallback.

The integration test now requires every captured native WER event to
contain a report ID and verifies that it matches WER's ReportIdentifier.
@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/wer-report-id branch from 3560db1 to d263703 Compare August 10, 2026 11:29
Comment thread src/backends/native/sentry_crash_daemon.c Outdated
Comment thread src/backends/native/sentry_crash_daemon.c Outdated
Comment thread tests/test_integration_wer.py

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 58e6929. Configure here.

Comment thread src/backends/native/sentry_crash_daemon.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants