Skip to content

Conversation

@bitsandfoxes
Copy link
Contributor

Unity SDK integrations pause and resume sessions in response to lifecycle events without knowing if a session is active. This causes repeated warnings from GlobalSessionManager ("Attempted to pause/resume a session, but a session has not been started") with no way for integrations to prevent them.

_options.LogWarning("Attempted to resume a session, but a session has not been started.");

This PR adds IHub.IsSessionActive to allow checking session state before pause/resume operations. This also gives users insights into whether there currently is a session active. I don't know how else they are supposed to deal any manual session handling anyway.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

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

Generated by 🚫 dangerJS against 2805139

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.20%. Comparing base (01d6bb8) to head (2805139).
⚠️ Report is 1 commits behind head on feat/cache-unhandled-session.

Files with missing lines Patch % Lines
src/Sentry/Extensibility/DisabledHub.cs 0.00% 1 Missing ⚠️
src/Sentry/Extensibility/HubAdapter.cs 0.00% 1 Missing ⚠️
src/Sentry/Internal/Hub.cs 0.00% 1 Missing ⚠️
src/Sentry/SentrySdk.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                        @@
##           feat/cache-unhandled-session    #4662      +/-   ##
================================================================
- Coverage                         73.21%   73.20%   -0.02%     
================================================================
  Files                               479      479              
  Lines                             17370    17374       +4     
  Branches                           3431     3431              
================================================================
  Hits                              12718    12718              
- Misses                             3803     3807       +4     
  Partials                            849      849              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant