Skip to content

feat: add session_changed_func backend hook - #2200

Merged
JoshuaMoelans merged 3 commits into
masterfrom
joshua/feat/session_changed_func
Oct 15, 2026
Merged

JoshuaMoelans merged 3 commits into
masterfrom
joshua/feat/session_changed_func

Conversation

@JoshuaMoelans

@JoshuaMoelans JoshuaMoelans commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Notify the backend, with the options lock held, whenever the current session starts, syncs its user via sentry_set_user() or ends. Backends that cannot run code at crash time (the Nintendo Switch backend, whose crash report is a region the OS snapshots) need the session mirrored ahead of a crash, the same way flush_scope_func mirrors the scope.

Related to https://github.com/getsentry/sentry-switch/pull/180

JoshuaMoelans and others added 2 commits October 14, 2026 13:07
Notify the backend, with the options lock held, whenever the current
session starts, syncs its user via sentry_set_user() or ends. Backends
that cannot run code at crash time (the Nintendo Switch backend, whose
crash report is a region the OS snapshots) need the session mirrored
ahead of a crash, the same way flush_scope_func mirrors the scope.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.57%. Comparing base (fab9b2c) to head (fc26e86).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2200      +/-   ##
==========================================
+ Coverage   75.39%   75.57%   +0.18%     
==========================================
  Files         103      103              
  Lines       28208    28220      +12     
  Branches     5168     5170       +2     
==========================================
+ Hits        21268    21328      +60     
+ Misses       5600     5540      -60     
- Partials     1340     1352      +12     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

sentry__capture_event flips `session->init` to false once the session
rides along with an event; a backend mirroring the session must learn
about that, otherwise a later crash report would announce the same
session as new a second time.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@JoshuaMoelans JoshuaMoelans changed the title (WIP) feat: add session_changed_func backend hook (WIP) feat: add session_changed_func backend hook Oct 14, 2026
@JoshuaMoelans
JoshuaMoelans marked this pull request as ready for review October 15, 2026 08:53
@JoshuaMoelans
JoshuaMoelans requested a review from jpnurmi October 15, 2026 08:54
@JoshuaMoelans JoshuaMoelans changed the title (WIP) feat: add session_changed_func backend hook feat: add session_changed_func backend hook Oct 15, 2026
@github-actions

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 fc26e86

@JoshuaMoelans
JoshuaMoelans merged commit d458aed into master Oct 15, 2026
72 checks passed
@JoshuaMoelans
JoshuaMoelans deleted the joshua/feat/session_changed_func branch October 15, 2026 09:06
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