Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
c3d01c1
Initial setup
bitsandfoxes Oct 14, 2025
38ac24d
Move terminal state into mechanism
bitsandfoxes Oct 15, 2025
54d3b2f
Format code
getsentry-bot Oct 15, 2025
f44a687
Made Terminal nullable
bitsandfoxes Oct 15, 2025
de5e1b5
Merge branch 'feat/session-type-unhandled' of https://github.com/gets…
bitsandfoxes Oct 15, 2025
b6c4c58
Updated CHANGELOG.md
bitsandfoxes Oct 15, 2025
dec8f34
Bump because vulnerability
bitsandfoxes Oct 15, 2025
16179d8
Conditionally add the terminal key
bitsandfoxes Oct 15, 2025
3ecb136
Updated verify
bitsandfoxes Oct 16, 2025
d657e0b
merged version6
bitsandfoxes Oct 16, 2025
d9c2d73
Cache unhandled sessions instead of sending right away
bitsandfoxes Oct 17, 2025
f95bff3
Merge branch 'version6' into feat/session-type-unhandled
bitsandfoxes Oct 17, 2025
fac1ab4
Moved 'terminal' into data bag
bitsandfoxes Oct 17, 2025
7a59034
Keep the key
bitsandfoxes Oct 17, 2025
413a9e8
Merge branch 'feat/session-type-unhandled' into feat/cache-unhandled-…
bitsandfoxes Oct 17, 2025
660714e
.
bitsandfoxes Oct 17, 2025
0c47b3f
Updated verify for net48
bitsandfoxes Oct 20, 2025
04d8889
Wrap exception type with enum
bitsandfoxes Oct 20, 2025
4c24f51
Logging
bitsandfoxes Oct 20, 2025
bbefdd3
Prevent Mechanism.TerminalKey from being serialized
bitsandfoxes Oct 20, 2025
fe4e915
Filter Terminal in WriteTo
bitsandfoxes Oct 20, 2025
31416f9
Make TerminalKey top level but don't serialize
bitsandfoxes Oct 20, 2025
1ad719c
Fixed tests
bitsandfoxes Oct 20, 2025
6508e5e
Pulled unhandled changes into this
bitsandfoxes Oct 20, 2025
4d6fb3f
Replaced API
bitsandfoxes Oct 20, 2025
1348053
Merge branch 'feat/session-type-unhandled' into feat/cache-unhandled-…
bitsandfoxes Oct 20, 2025
624524f
Added net4_8 verify
bitsandfoxes Oct 20, 2025
0502cd7
Merge branch 'feat/session-type-unhandled' into feat/cache-unhandled-…
bitsandfoxes Oct 20, 2025
b94c400
Updated CHANGELOG.md
bitsandfoxes Oct 20, 2025
225f67a
Cleanup
bitsandfoxes Oct 20, 2025
f06513d
Is this the one that is missing?
bitsandfoxes Oct 21, 2025
7527bdd
Merge branch 'feat/cache-unhandled-session' of https://github.com/get…
bitsandfoxes Oct 21, 2025
080493b
Added to the API
bitsandfoxes Oct 21, 2025
01d6bb8
Fixed my own mess. yey.
bitsandfoxes Oct 21, 2025
4dc0230
Merge branch 'feat/cache-unhandled-session' into feat/active-session
bitsandfoxes Oct 21, 2025
48ce2fc
Verify
bitsandfoxes Oct 21, 2025
2805139
Updated CHANGELOG.md
bitsandfoxes Oct 21, 2025
a7ff327
Interlock marking
bitsandfoxes Oct 21, 2025
a41b316
Update src/Sentry/Platforms/Android/LogCatAttachmentEventProcessor.cs
bitsandfoxes Oct 24, 2025
352fd01
Merge branch 'version6' into feat/session-type-unhandled
bitsandfoxes Oct 24, 2025
a1500c3
Unhandled -> UnhandledTerminal
bitsandfoxes Oct 24, 2025
73a6c01
Apply suggestions from code review
bitsandfoxes Oct 29, 2025
410c373
Merge branch 'feat/session-type-unhandled' into feat/cache-unhandled-…
bitsandfoxes Oct 29, 2025
35784e6
Merge branch 'feat/cache-unhandled-session' of https://github.com/get…
bitsandfoxes Oct 29, 2025
1a72f29
Fix import and persist unhandled mark when pausing
bitsandfoxes Oct 29, 2025
32bf6d2
Merged 'version6'
bitsandfoxes Oct 29, 2025
a829dbd
Merge branch 'feat/cache-unhandled-session' into feat/active-session
bitsandfoxes Oct 29, 2025
5a11ac5
Merge branch 'version6' into feat/active-session
bitsandfoxes Oct 29, 2025
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
### Features

- The SDK now makes use of the new SessionEndStatus `Unhandled` when capturing an unhandled but non-terminal exception, i.e. through the UnobservedTaskExceptionIntegration ([#4633](https://github.com/getsentry/sentry-dotnet/pull/4633), [#4653](https://github.com/getsentry/sentry-dotnet/pull/4653))
- The SDK now provides a `IsSessionActive` to allow checking the session state ([#4662](https://github.com/getsentry/sentry-dotnet/pull/4662))
- The SDK now makes use of the new SessionEndStatus `Unhandled` when capturing an unhandled but non-terminal exception, i.e. through the UnobservedTaskExceptionIntegration ([#4633](https://github.com/getsentry/sentry-dotnet/pull/4633))

### Fixes
Expand Down
5 changes: 5 additions & 0 deletions src/Sentry/Extensibility/DisabledHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public class DisabledHub : IHub, IDisposable
/// </summary>
public bool IsEnabled => false;

/// <summary>
/// Always returns false.
/// </summary>
public bool IsSessionActive => false;

private DisabledHub()
{
}
Expand Down
5 changes: 5 additions & 0 deletions src/Sentry/Extensibility/HubAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ private HubAdapter() { }
/// </summary>
public SentryStructuredLogger Logger { [DebuggerStepThrough] get => SentrySdk.Logger; }

/// <summary>
/// Forwards the call to <see cref="SentrySdk"/>.
/// </summary>
public bool IsSessionActive { [DebuggerStepThrough] get => SentrySdk.IsSessionActive; }

/// <summary>
/// Forwards the call to <see cref="SentrySdk"/>.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/Sentry/IHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public TransactionContext ContinueTrace(
string? name = null,
string? operation = null);

/// <summary>
/// Gets a value indicating whether there is an active session.
/// </summary>
public bool IsSessionActive { get; }

/// <summary>
/// Starts a new session.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions src/Sentry/Internal/Hub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ internal class Hub : IHub, IDisposable

public bool IsEnabled => _isEnabled;

public bool IsSessionActive => _sessionManager.IsSessionActive;

internal SentryOptions Options => _options;

private Scope CurrentScope => ScopeManager.GetCurrent().Key;
Expand Down
3 changes: 3 additions & 0 deletions src/Sentry/SentrySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,9 @@ public static TransactionContext ContinueTrace(
string? operation = null)
=> CurrentHub.ContinueTrace(traceHeader, baggageHeader, name, operation);

/// <inheritdoc cref="IHub.IsSessionActive"/>
public static bool IsSessionActive { [DebuggerStepThrough] get => CurrentHub.IsSessionActive; }

/// <inheritdoc cref="IHub.StartSession"/>
[DebuggerStepThrough]
public static void StartSession()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ namespace Sentry
}
public interface IHub : Sentry.ISentryClient, Sentry.ISentryScopeManager
{
bool IsSessionActive { get; }
Sentry.SentryId LastEventId { get; }
Sentry.SentryStructuredLogger Logger { get; }
void BindException(System.Exception exception, Sentry.ISpan span);
Expand Down Expand Up @@ -826,6 +827,7 @@ namespace Sentry
public static class SentrySdk
{
public static bool IsEnabled { get; }
public static bool IsSessionActive { get; }
public static Sentry.SentryId LastEventId { get; }
public static Sentry.SentryStructuredLogger Logger { get; }
public static void AddBreadcrumb(Sentry.Breadcrumb breadcrumb, Sentry.SentryHint? hint = null) { }
Expand Down Expand Up @@ -1370,6 +1372,7 @@ namespace Sentry.Extensibility
{
public static readonly Sentry.Extensibility.DisabledHub Instance;
public bool IsEnabled { get; }
public bool IsSessionActive { get; }
public Sentry.SentryId LastEventId { get; }
public Sentry.SentryStructuredLogger Logger { get; }
public void BindClient(Sentry.ISentryClient client) { }
Expand Down Expand Up @@ -1416,6 +1419,7 @@ namespace Sentry.Extensibility
{
public static readonly Sentry.Extensibility.HubAdapter Instance;
public bool IsEnabled { get; }
public bool IsSessionActive { get; }
public Sentry.SentryId LastEventId { get; }
public Sentry.SentryStructuredLogger Logger { get; }
public void AddBreadcrumb(string message, string? category = null, string? type = null, System.Collections.Generic.IDictionary<string, string>? data = null, Sentry.BreadcrumbLevel level = 0) { }
Expand Down
4 changes: 4 additions & 0 deletions test/Sentry.Tests/ApiApprovalTests.Run.DotNet8_0.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ namespace Sentry
}
public interface IHub : Sentry.ISentryClient, Sentry.ISentryScopeManager
{
bool IsSessionActive { get; }
Sentry.SentryId LastEventId { get; }
Sentry.SentryStructuredLogger Logger { get; }
void BindException(System.Exception exception, Sentry.ISpan span);
Expand Down Expand Up @@ -826,6 +827,7 @@ namespace Sentry
public static class SentrySdk
{
public static bool IsEnabled { get; }
public static bool IsSessionActive { get; }
public static Sentry.SentryId LastEventId { get; }
public static Sentry.SentryStructuredLogger Logger { get; }
public static void AddBreadcrumb(Sentry.Breadcrumb breadcrumb, Sentry.SentryHint? hint = null) { }
Expand Down Expand Up @@ -1370,6 +1372,7 @@ namespace Sentry.Extensibility
{
public static readonly Sentry.Extensibility.DisabledHub Instance;
public bool IsEnabled { get; }
public bool IsSessionActive { get; }
public Sentry.SentryId LastEventId { get; }
public Sentry.SentryStructuredLogger Logger { get; }
public void BindClient(Sentry.ISentryClient client) { }
Expand Down Expand Up @@ -1416,6 +1419,7 @@ namespace Sentry.Extensibility
{
public static readonly Sentry.Extensibility.HubAdapter Instance;
public bool IsEnabled { get; }
public bool IsSessionActive { get; }
public Sentry.SentryId LastEventId { get; }
public Sentry.SentryStructuredLogger Logger { get; }
public void AddBreadcrumb(string message, string? category = null, string? type = null, System.Collections.Generic.IDictionary<string, string>? data = null, Sentry.BreadcrumbLevel level = 0) { }
Expand Down
4 changes: 4 additions & 0 deletions test/Sentry.Tests/ApiApprovalTests.Run.DotNet9_0.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ namespace Sentry
}
public interface IHub : Sentry.ISentryClient, Sentry.ISentryScopeManager
{
bool IsSessionActive { get; }
Sentry.SentryId LastEventId { get; }
Sentry.SentryStructuredLogger Logger { get; }
void BindException(System.Exception exception, Sentry.ISpan span);
Expand Down Expand Up @@ -826,6 +827,7 @@ namespace Sentry
public static class SentrySdk
{
public static bool IsEnabled { get; }
public static bool IsSessionActive { get; }
public static Sentry.SentryId LastEventId { get; }
public static Sentry.SentryStructuredLogger Logger { get; }
public static void AddBreadcrumb(Sentry.Breadcrumb breadcrumb, Sentry.SentryHint? hint = null) { }
Expand Down Expand Up @@ -1370,6 +1372,7 @@ namespace Sentry.Extensibility
{
public static readonly Sentry.Extensibility.DisabledHub Instance;
public bool IsEnabled { get; }
public bool IsSessionActive { get; }
public Sentry.SentryId LastEventId { get; }
public Sentry.SentryStructuredLogger Logger { get; }
public void BindClient(Sentry.ISentryClient client) { }
Expand Down Expand Up @@ -1416,6 +1419,7 @@ namespace Sentry.Extensibility
{
public static readonly Sentry.Extensibility.HubAdapter Instance;
public bool IsEnabled { get; }
public bool IsSessionActive { get; }
public Sentry.SentryId LastEventId { get; }
public Sentry.SentryStructuredLogger Logger { get; }
public void AddBreadcrumb(string message, string? category = null, string? type = null, System.Collections.Generic.IDictionary<string, string>? data = null, Sentry.BreadcrumbLevel level = 0) { }
Expand Down
4 changes: 4 additions & 0 deletions test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ namespace Sentry
}
public interface IHub : Sentry.ISentryClient, Sentry.ISentryScopeManager
{
bool IsSessionActive { get; }
Sentry.SentryId LastEventId { get; }
Sentry.SentryStructuredLogger Logger { get; }
void BindException(System.Exception exception, Sentry.ISpan span);
Expand Down Expand Up @@ -802,6 +803,7 @@ namespace Sentry
public static class SentrySdk
{
public static bool IsEnabled { get; }
public static bool IsSessionActive { get; }
public static Sentry.SentryId LastEventId { get; }
public static Sentry.SentryStructuredLogger Logger { get; }
public static void AddBreadcrumb(Sentry.Breadcrumb breadcrumb, Sentry.SentryHint? hint = null) { }
Expand Down Expand Up @@ -1346,6 +1348,7 @@ namespace Sentry.Extensibility
{
public static readonly Sentry.Extensibility.DisabledHub Instance;
public bool IsEnabled { get; }
public bool IsSessionActive { get; }
public Sentry.SentryId LastEventId { get; }
public Sentry.SentryStructuredLogger Logger { get; }
public void BindClient(Sentry.ISentryClient client) { }
Expand Down Expand Up @@ -1392,6 +1395,7 @@ namespace Sentry.Extensibility
{
public static readonly Sentry.Extensibility.HubAdapter Instance;
public bool IsEnabled { get; }
public bool IsSessionActive { get; }
public Sentry.SentryId LastEventId { get; }
public Sentry.SentryStructuredLogger Logger { get; }
public void AddBreadcrumb(string message, string? category = null, string? type = null, System.Collections.Generic.IDictionary<string, string>? data = null, Sentry.BreadcrumbLevel level = 0) { }
Expand Down
Loading