sentry-dotnet icon indicating copy to clipboard operation
sentry-dotnet copied to clipboard

Incorrect release version detection for MacOS applications

Open TimBurik opened this issue 4 months ago • 11 comments

Package

Sentry

.NET Flavor

.NET

.NET Version

8.0.303

OS

macOS

SDK Version

4.10.2

Self-Hosted Sentry Version

No response

Steps to Reproduce

  1. Create a sample project Sentry.Test which targets .net8-macos
  2. Specify application identifier and version in the Info.plist:
<key>CFBundleIdentifier</key>
<string>com.Test.Sentry-Mac</string>
<key>CFBundleShortVersionString</key>
<string>5.55.0</string>
<key>CFBundleVersion</key>
<string>555</string>
  1. Add Sentry nuget package, initialize it from the NSApplicationDelegate.DidFinishLaunching() callback
  2. Capture and send any exception using SentrySdk.CaptureException()

Expected Result

Captured exception is reported with a release version in the format "<bundle_identifier>@<bundle_short_version>+<bundle_version>", in this case it should be "[email protected]+555"

Actual Result

Captured exception is reported with a release version of "[email protected]+3698dd19ef2b4114dd77aed39cc71fd09a9c6586", which seems to be an assembly name and version + git commit hash

It seems that if application is targeting .net8-macos - Sentry Cocoa SDK is not initialized at all, even though it feels like it should. https://github.com/getsentry/sentry-dotnet/blob/33be706eda6b4281e97de82e3f7b025e1e764e30/src/Sentry/SentrySdk.cs#L67-L69

TimBurik avatar Sep 30 '24 12:09 TimBurik