Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 15 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Features

- Extended `SentryThread` by `Main` to allow indication whether the thread is considered the current main thread ([#4807](https://github.com/getsentry/sentry-dotnet/pull/4807))

## 6.0.0

### BREAKING CHANGES
Expand Down Expand Up @@ -45,25 +51,24 @@
- Deliver system breadcrumbs in the main thread on Android ([#4671](https://github.com/getsentry/sentry-dotnet/pull/4671))
- The `Serilog` integration captures _Structured Logs_ (when enabled) independently of captured Events and added Breadcrumbs ([#4691](https://github.com/getsentry/sentry-dotnet/pull/4691))
- Minimum Log-Level for _Structured Logs_, _Breadcrumbs_ and _Events_ in all Logging-Integrations ([#4700](https://github.com/getsentry/sentry-dotnet/pull/4700))
- for `Sentry.Extensions.Logging`, `Sentry.AspNetCore`, `Sentry.Maui` and `Sentry.Google.Cloud.Functions`
- the Logger-Provider for _Breadcrumbs_ and _Events_ ignores Logging-Configuration (e.g. via `appsettings.json`)
- use the intended `SentryLoggingOptions.MinimumBreadcrumbLevel`, `SentryLoggingOptions.MinimumEventLevel`, or add filter functions via `SentryLoggingOptionsExtensions.AddLogEntryFilter`
- the Logger-Provider for _Structured Logs_ respects Logging-Configuration (e.g. via `appsettings.json`)
- when enabled by `SentryOptions.EnableLogs`
- for `Sentry.Extensions.Logging`, `Sentry.AspNetCore`, `Sentry.Maui` and `Sentry.Google.Cloud.Functions`
- the Logger-Provider for _Breadcrumbs_ and _Events_ ignores Logging-Configuration (e.g. via `appsettings.json`)
- use the intended `SentryLoggingOptions.MinimumBreadcrumbLevel`, `SentryLoggingOptions.MinimumEventLevel`, or add filter functions via `SentryLoggingOptionsExtensions.AddLogEntryFilter`
- the Logger-Provider for _Structured Logs_ respects Logging-Configuration (e.g. via `appsettings.json`)
- when enabled by `SentryOptions.EnableLogs`
- Avoid appending `/NODEFAULTLIB:MSVCRT` to NativeAOT linker arguments on Windows when targetting non-Windows platforms (Android, Browser) ([#4760](https://github.com/getsentry/sentry-dotnet/pull/4760))
- The SDK avoids redundant scope sync after transaction finish ([#4623](https://github.com/getsentry/sentry-dotnet/pull/4623))
- sentry-native is now automatically disabled for WASM applications ([#4631](https://github.com/getsentry/sentry-dotnet/pull/4631))
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602))


### Dependencies

- Bump Java SDK from v8.24.0 to v8.28.0 ([#4728](https://github.com/getsentry/sentry-dotnet/pull/4728), [#4761](https://github.com/getsentry/sentry-dotnet/pull/4761), [#4791](https://github.com/getsentry/sentry-dotnet/pull/4791))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8280)
- [diff](https://github.com/getsentry/sentry-java/compare/8.24.0...8.28.0)
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8280)
- [diff](https://github.com/getsentry/sentry-java/compare/8.24.0...8.28.0)
- Bump Native SDK from v0.12.0 to v0.12.2 ([#4690](https://github.com/getsentry/sentry-dotnet/pull/4690), [#4737](https://github.com/getsentry/sentry-dotnet/pull/4737), [#4780](https://github.com/getsentry/sentry-dotnet/pull/4780))
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0122)
- [diff](https://github.com/getsentry/sentry-native/compare/0.12.0...0.12.2)
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0122)
- [diff](https://github.com/getsentry/sentry-native/compare/0.12.0...0.12.2)
- Bump Cocoa SDK from v8.57.1 to v8.57.3 ([#4704](https://github.com/getsentry/sentry-dotnet/pull/4704), [#4738](https://github.com/getsentry/sentry-dotnet/pull/4738))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8573)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.57.1...8.57.3)
Expand Down
10 changes: 10 additions & 0 deletions src/Sentry/SentryThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ public sealed class SentryThread : ISentryJsonSerializable
/// </summary>
public bool? Current { get; set; }

/// <summary>
/// An optional flag to indicate whether the thread was responsible for rendering
/// the user interface. On mobile and desktop platforms this is oftentimes referred to as the
/// "main thread" or "ui thread".
/// </summary>
public bool? Main { get; set; }

/// <summary>
/// Stack trace.
/// </summary>
Expand All @@ -44,6 +51,7 @@ public void WriteTo(Utf8JsonWriter writer, IDiagnosticLogger? logger)
writer.WriteStringIfNotWhiteSpace("name", Name);
writer.WriteBooleanIfNotNull("crashed", Crashed);
writer.WriteBooleanIfNotNull("current", Current);
writer.WriteBooleanIfNotNull("main", Main);
writer.WriteSerializableIfNotNull("stacktrace", Stacktrace, logger);

writer.WriteEndObject();
Expand All @@ -58,6 +66,7 @@ public static SentryThread FromJson(JsonElement json)
var name = json.GetPropertyOrNull("name")?.GetString();
var crashed = json.GetPropertyOrNull("crashed")?.GetBoolean();
var current = json.GetPropertyOrNull("current")?.GetBoolean();
var main = json.GetPropertyOrNull("main")?.GetBoolean();
var stacktrace = json.GetPropertyOrNull("stacktrace")?.Pipe(SentryStackTrace.FromJson);

return new SentryThread
Expand All @@ -66,6 +75,7 @@ public static SentryThread FromJson(JsonElement json)
Name = name,
Crashed = crashed,
Current = current,
Main = main,
Stacktrace = stacktrace
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ namespace Sentry
public bool? Crashed { get; set; }
public bool? Current { get; set; }
public int? Id { get; set; }
public bool? Main { get; set; }
public string? Name { get; set; }
public Sentry.SentryStackTrace? Stacktrace { get; set; }
public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ namespace Sentry
public bool? Crashed { get; set; }
public bool? Current { get; set; }
public int? Id { get; set; }
public bool? Main { get; set; }
public string? Name { get; set; }
public Sentry.SentryStackTrace? Stacktrace { get; set; }
public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ namespace Sentry
public bool? Crashed { get; set; }
public bool? Current { get; set; }
public int? Id { get; set; }
public bool? Main { get; set; }
public string? Name { get; set; }
public Sentry.SentryStackTrace? Stacktrace { get; set; }
public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ namespace Sentry
public bool? Crashed { get; set; }
public bool? Current { get; set; }
public int? Id { get; set; }
public bool? Main { get; set; }
public string? Name { get; set; }
public Sentry.SentryStackTrace? Stacktrace { get; set; }
public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { }
Expand Down
4 changes: 4 additions & 0 deletions test/Sentry.Tests/Protocol/SentryThreadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public void SerializeObject_AllPropertiesSetToNonDefault_SerializesValidObject()
{
Crashed = true,
Current = true,
Main = true,
Id = 0,
Name = "thread11",
Stacktrace = new SentryStackTrace
Expand All @@ -35,6 +36,7 @@ public void SerializeObject_AllPropertiesSetToNonDefault_SerializesValidObject()
"name": "thread11",
"crashed": true,
"current": true,
"main": true,
"stacktrace": {
"frames": [
{
Expand Down Expand Up @@ -62,6 +64,8 @@ public static IEnumerable<object[]> TestCases()
yield return new object[] { (new SentryThread { Name = "some name" }, """{"name":"some name"}""") };
yield return new object[] { (new SentryThread { Crashed = false }, """{"crashed":false}""") };
yield return new object[] { (new SentryThread { Current = false }, """{"current":false}""") };
yield return new object[] { (new SentryThread { Main = false }, """{"main":false}""") };
yield return new object[] { (new SentryThread { Main = true }, """{"main":true}""") };
yield return new object[] { (new SentryThread { Id = 200 }, """{"id":200}""") };
yield return new object[] { (new SentryThread { Stacktrace = new SentryStackTrace { Frames = { new SentryStackFrame { InApp = true } } } },
"""{"stacktrace":{"frames":[{"in_app":true}]}}""") };
Expand Down
Loading