Skip to content

Commit 352fd01

Browse files
committed
Merge branch 'version6' into feat/session-type-unhandled
2 parents a41b316 + 382fa2e commit 352fd01

29 files changed

+577
-162
lines changed

.editorconfig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,14 @@ indent_size = unset
207207
indent_style = unset
208208
insert_final_newline = false
209209
tab_width = unset
210-
trim_trailing_whitespace = false
210+
trim_trailing_whitespace = false
211+
212+
# Disable AOT analyser for test files
213+
[test/**/*.cs]
214+
dotnet_diagnostic.IL2026.severity = none
215+
dotnet_diagnostic.IL2070.severity = none
216+
dotnet_diagnostic.IL2075.severity = none
217+
dotnet_diagnostic.IL2090.severity = none
218+
219+
# This appears to be broken and results in false positives (causing dotnet format to delete valid test scenarios)
220+
dotnet_diagnostic.xUnit1025.severity = none

.github/actions/environment/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ runs:
4444
uses: ./.github/actions/install-zstd
4545

4646
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode
47+
# Also https://github.com/dotnet/macios/issues/21762#issuecomment-3424033859 (don't reference symlinks)
4748
- name: Pin the Xcode Version
4849
if: runner.os == 'macOS'
4950
shell: bash
50-
run: sudo xcode-select --switch /Applications/Xcode_16.4.app
51+
run: sudo xcode-select --switch /Applications/Xcode_26.0.1.app
5152

5253
# Java 17 is needed for Android SDK setup step
5354
- name: Install Java 17
@@ -97,7 +98,7 @@ runs:
9798
dotnet-version: |
9899
8.0.x
99100
9.0.304
100-
10.0.100-rc.1.25451.107
101+
10.0.100-rc.2.25502.107
101102
102103
# .NET 5.0 does not support ARM64 on macOS
103104
- name: Install .NET 5.0 SDK

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@
1212
- Removed `SentrySdk.CaptureUserFeedback` and all associated members. Use the newer `SentrySdk.CaptureFeedback` instead.
1313
- Backpressure handling is now enabled by default, meaning that the SDK will monitor system health and reduce the sampling rate of events and transactions when the system is under load. When the system is determined to be healthy again, the sampling rates are returned to their original levels. ([#4615](https://github.com/getsentry/sentry-dotnet/pull/4615))
1414
- ScopeExtensions.Populate is now internal ([#4611](https://github.com/getsentry/sentry-dotnet/pull/4611))
15+
- Add support for W3C traceparent header for outgoing requests ([#4661](https://github.com/getsentry/sentry-dotnet/pull/4661))
16+
This feature is disabled by default. When enabled, outgoing requests will include the W3C traceparent header.
17+
```csharp
18+
SentrySdk.Init(options =>
19+
{
20+
// ...
21+
options.PropagateTraceparent = true;
22+
});
23+
```
24+
25+
See https://develop.sentry.dev/sdk/telemetry/traces/distributed-tracing/#w3c-trace-context-header for more details.
1526

1627
### Features
1728

Directory.Build.props

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
<CurrentTfms>net8.0;net9.0;net10.0</CurrentTfms>
3535
<LatestAndroidTfm>net10.0-android36.0</LatestAndroidTfm>
3636
<PreviousAndroidTfm>net9.0-android35.0</PreviousAndroidTfm>
37-
<LatestIosTfm>net9.0-ios26</LatestIosTfm>
37+
<LatestIosTfm>net10.0-ios26</LatestIosTfm>
3838
<PreviousIosTfm>net9.0-ios18.0</PreviousIosTfm>
39-
<LatestMacCatalystTfm>net9.0-maccatalyst26</LatestMacCatalystTfm>
39+
<LatestMacCatalystTfm>net10.0-maccatalyst26</LatestMacCatalystTfm>
4040
<PreviousMacCatalystTfm>net9.0-maccatalyst18.0</PreviousMacCatalystTfm>
4141
<PreviousWindowsTfm>net9.0-windows10.0.19041.0</PreviousWindowsTfm>
4242
</PropertyGroup>
@@ -114,6 +114,10 @@
114114
<MemoryDumpSupported Condition="!($(PlatformIsLegacy) == 'true' or $(PlatformIsMobile) == 'true')">true</MemoryDumpSupported>
115115

116116
<DefineConstants Condition="'$(MemoryDumpSupported)' == 'true'">$(DefineConstants);MEMORY_DUMP_SUPPORTED</DefineConstants>
117+
118+
<!-- Workaround for this issue https://github.com/dotnet/sdk/issues/51265#issuecomment-3416621522 -->
119+
<RestoreEnablePackagePruning Condition="'$(PlatformIsLegacy)' == 'true' "> false</RestoreEnablePackagePruning>
120+
117121
</PropertyGroup>
118122

119123
<!-- Public key of .assets/Sentry.snk - not a secret. Used by other InternalsVisibleTo entries throughout the solution. -->

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"sdk": {
3-
"version": "10.0.100-rc.1.25451.107",
4-
"workloadVersion": "10.0.100-rc.1.25458.2",
3+
"version": "10.0.100-rc.2.25502.107",
4+
"workloadVersion": "10.0.100-rc.2.25513.4",
55
"rollForward": "disable",
66
"allowPrerelease": false
77
}

integration-test/android.Tests.ps1

Lines changed: 70 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,37 @@ BeforeDiscovery {
1212
$script:emulator = Get-AndroidEmulatorId
1313
}
1414

15-
Describe 'MAUI app' -ForEach @(
16-
@{ tfm = "net9.0-android35.0" }
15+
Describe 'MAUI app (<tfm>, <configuration>)' -ForEach @(
16+
@{ tfm = "net9.0-android35.0"; configuration = "Release" }
17+
@{ tfm = "net9.0-android35.0"; configuration = "Debug" }
1718
) -Skip:(-not $script:emulator) {
1819
BeforeAll {
1920
Remove-Item -Path "$PSScriptRoot/mobile-app" -Recurse -Force -ErrorAction SilentlyContinue
2021
Copy-Item -Path "$PSScriptRoot/net9-maui" -Destination "$PSScriptRoot/mobile-app" -Recurse -Force
2122
Push-Location $PSScriptRoot/mobile-app
2223

23-
function InstallAndroidApp
24-
{
25-
param([string] $Dsn)
26-
$dsn = $Dsn.Replace('http://', 'http://key@') + '/0'
27-
28-
# replace {{SENTRY_DSN}} in MauiProgram.cs
29-
(Get-Content MauiProgram.cs) `
30-
-replace '\{\{SENTRY_DSN\}\}', $dsn `
31-
| Set-Content MauiProgram.cs
24+
# replace {{SENTRY_DSN}} in MauiProgram.cs
25+
(Get-Content MauiProgram.cs) `
26+
-replace '\{\{SENTRY_DSN\}\}', 'http://key@127.0.0.1:8000/0' `
27+
| Set-Content MauiProgram.cs
3228

33-
$arch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLower()
34-
$rid = "android-$arch"
29+
$arch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLower()
30+
$rid = "android-$arch"
3531

36-
Write-Host "::group::Build Sentry.Maui.Device.IntegrationTestApp.csproj"
37-
dotnet build Sentry.Maui.Device.IntegrationTestApp.csproj `
38-
--configuration Release `
39-
--framework $tfm `
40-
--runtime $rid
41-
| ForEach-Object { Write-Host $_ }
42-
Write-Host '::endgroup::'
43-
$LASTEXITCODE | Should -Be 0
32+
Write-Host "::group::Build Sentry.Maui.Device.IntegrationTestApp.csproj"
33+
dotnet build Sentry.Maui.Device.IntegrationTestApp.csproj `
34+
--configuration $configuration `
35+
--framework $tfm `
36+
--runtime $rid
37+
| ForEach-Object { Write-Host $_ }
38+
Write-Host '::endgroup::'
39+
$LASTEXITCODE | Should -Be 0
4440

45-
Write-Host "::group::Install bin/Release/$tfm/$rid/io.sentry.dotnet.maui.device.integrationtestapp-Signed.apk"
41+
function InstallAndroidApp
42+
{
43+
Write-Host "::group::Install bin/$configuration/$tfm/$rid/io.sentry.dotnet.maui.device.integrationtestapp-Signed.apk"
4644
xharness android install -v `
47-
--app bin/Release/$tfm/$rid/io.sentry.dotnet.maui.device.integrationtestapp-Signed.apk `
45+
--app bin/$configuration/$tfm/$rid/io.sentry.dotnet.maui.device.integrationtestapp-Signed.apk `
4846
--package-name io.sentry.dotnet.maui.device.integrationtestapp `
4947
--output-directory=test_output
5048
| ForEach-Object { Write-Host $_ }
@@ -58,35 +56,25 @@ Describe 'MAUI app' -ForEach @(
5856
[string] $Dsn,
5957
[string] $TestArg = 'None'
6058
)
59+
Write-Host "::group::Run Android app (TestArg=$TestArg)"
60+
$dsn = $Dsn.Replace('http://', 'http://key@') + '/0'
61+
xharness android adb -v `
62+
-- shell am start -S -n io.sentry.dotnet.maui.device.integrationtestapp/.MainActivity `
63+
-e SENTRY_DSN $dsn `
64+
-e SENTRY_TEST_ARG $TestArg
65+
| ForEach-Object { Write-Host $_ }
66+
Write-Host '::endgroup::'
67+
$LASTEXITCODE | Should -Be 0
6168

62-
try
69+
do
6370
{
64-
# Setup port forwarding for accessing sentry-server at 127.0.0.1:8000 from the emulator
65-
$port = $Dsn.Split(':')[2].Split('/')[0]
66-
xharness android adb -v -- reverse tcp:$port tcp:$port
67-
68-
Write-Host "::group::Run Android app (TestArg=$TestArg)"
69-
xharness android adb -v `
70-
-- shell am start -S -n io.sentry.dotnet.maui.device.integrationtestapp/.MainActivity `
71-
-e SENTRY_TEST_ARG $TestArg
72-
| ForEach-Object { Write-Host $_ }
73-
Write-Host '::endgroup::'
74-
$LASTEXITCODE | Should -Be 0
71+
Write-Host "Waiting for app..."
72+
Start-Sleep -Seconds 1
7573

76-
do
77-
{
78-
Write-Host "Waiting for app..."
79-
Start-Sleep -Seconds 1
74+
$procid = (& xharness android adb -- shell pidof "io.sentry.dotnet.maui.device.integrationtestapp") -replace '\s', ''
75+
$activity = (& xharness android adb -- shell dumpsys activity activities) -match "io\.sentry\.dotnet\.maui\.device\.integrationtestapp"
8076

81-
$procid = (& xharness android adb -- shell pidof "io.sentry.dotnet.maui.device.integrationtestapp") -replace '\s', ''
82-
$activity = (& xharness android adb -- shell dumpsys activity activities) -match "io\.sentry\.dotnet\.maui\.device\.integrationtestapp"
83-
84-
} while ($procid -and $activity)
85-
}
86-
finally
87-
{
88-
xharness android adb -v -- reverse --remove-all
89-
}
77+
} while ($procid -and $activity)
9078
}
9179

9280
function UninstallAndroidApp
@@ -111,20 +99,27 @@ Describe 'MAUI app' -ForEach @(
11199
Write-Host '::endgroup::'
112100
}
113101
}
102+
103+
# Setup port forwarding for accessing sentry-server at 127.0.0.1:8000 from the emulator
104+
xharness android adb -v -- reverse tcp:8000 tcp:8000
114105
}
115106

116107
AfterAll {
117108
Pop-Location
109+
xharness android adb -v -- reverse --remove tcp:8000
110+
}
111+
112+
BeforeEach {
113+
InstallAndroidApp
118114
}
119115

120116
AfterEach {
121117
UninstallAndroidApp
122118
}
123119

124-
It 'Managed crash' {
120+
It 'Managed crash (<configuration>)' {
125121
$result = Invoke-SentryServer {
126122
param([string]$url)
127-
InstallAndroidApp -Dsn $url
128123
RunAndroidApp -Dsn $url -TestArg "Managed"
129124
RunAndroidApp -Dsn $url
130125
}
@@ -133,12 +128,12 @@ Describe 'MAUI app' -ForEach @(
133128
$result.HasErrors() | Should -BeFalse
134129
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.ApplicationException`""
135130
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGABRT`""
131+
$result.Envelopes() | Should -HaveCount 1
136132
}
137133

138-
It 'Java crash' {
134+
It 'Java crash (<configuration>)' {
139135
$result = Invoke-SentryServer {
140136
param([string]$url)
141-
InstallAndroidApp -Dsn $url
142137
RunAndroidApp -Dsn $url -TestArg "Java"
143138
RunAndroidApp -Dsn $url
144139
}
@@ -147,20 +142,39 @@ Describe 'MAUI app' -ForEach @(
147142
$result.HasErrors() | Should -BeFalse
148143
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"RuntimeException`""
149144
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"System.\w+Exception`""
145+
$result.Envelopes() | Should -HaveCount 1
146+
}
147+
148+
It 'Native crash (<configuration>)' {
149+
$result = Invoke-SentryServer {
150+
param([string]$url)
151+
RunAndroidApp -Dsn $url -TestArg "Native"
152+
RunAndroidApp -Dsn $url
153+
}
154+
155+
Dump-ServerErrors -Result $result
156+
$result.HasErrors() | Should -BeFalse
157+
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"SIG[A-Z]+`"" # SIGILL (x86_64), SIGTRAP (arm64-v8a)
158+
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"System.\w+Exception`""
159+
$result.Envelopes() | Should -HaveCount 1
150160
}
151161

152-
It 'Null reference exception' {
162+
It 'Null reference exception (<configuration>)' {
153163
$result = Invoke-SentryServer {
154164
param([string]$url)
155-
InstallAndroidApp -Dsn $url
156165
RunAndroidApp -Dsn $url -TestArg "NullReferenceException"
157166
RunAndroidApp -Dsn $url
158167
}
159168

160169
Dump-ServerErrors -Result $result
161170
$result.HasErrors() | Should -BeFalse
162171
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.NullReferenceException`""
163-
# TODO: fix redundant RuntimeException (#3954)
164-
{ $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" } | Should -Throw
172+
# TODO: fix redundant SIGSEGV in Release (#3954)
173+
if ($configuration -eq "Release") {
174+
{ $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`"" } | Should -Throw
175+
} else {
176+
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGSEGV`""
177+
$result.Envelopes() | Should -HaveCount 1
178+
}
165179
}
166180
}

integration-test/ios.Tests.ps1

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ BeforeDiscovery {
1111
$script:simulator = Get-IosSimulatorUdid -PreferredStates @('Booted')
1212
}
1313

14-
Describe 'iOS app (<tfm>)' -ForEach @(
15-
@{ tfm = "net9.0-ios18.0" }
14+
Describe 'iOS app (<tfm>, <configuration>)' -ForEach @(
15+
@{ tfm = "net9.0-ios18.0"; configuration = "Release" }
16+
@{ tfm = "net9.0-ios18.0"; configuration = "Debug" }
1617
) -Skip:(-not $script:simulator) {
1718
BeforeAll {
1819
. $PSScriptRoot/../scripts/device-test-utils.ps1
@@ -26,7 +27,7 @@ Describe 'iOS app (<tfm>)' -ForEach @(
2627

2728
Write-Host "::group::Build Sentry.Maui.Device.IntegrationTestApp.csproj"
2829
dotnet build Sentry.Maui.Device.IntegrationTestApp.csproj `
29-
--configuration Release `
30+
--configuration $configuration `
3031
--framework $tfm `
3132
--runtime $rid
3233
| ForEach-Object { Write-Host $_ }
@@ -35,9 +36,9 @@ Describe 'iOS app (<tfm>)' -ForEach @(
3536

3637
function InstallIosApp
3738
{
38-
Write-Host "::group::Install bin/Release/$tfm/$rid/Sentry.Maui.Device.IntegrationTestApp.app"
39+
Write-Host "::group::Install bin/$configuration/$tfm/$rid/Sentry.Maui.Device.IntegrationTestApp.app"
3940
xcrun simctl install $simulator `
40-
bin/Release/$tfm/$rid/Sentry.Maui.Device.IntegrationTestApp.app
41+
bin/$configuration/$tfm/$rid/Sentry.Maui.Device.IntegrationTestApp.app
4142
| ForEach-Object { Write-Host $_ }
4243
Write-Host '::endgroup::'
4344
$LASTEXITCODE | Should -Be 0
@@ -86,7 +87,7 @@ Describe 'iOS app (<tfm>)' -ForEach @(
8687
UninstallIosApp
8788
}
8889

89-
It 'captures managed crash' {
90+
It 'captures managed crash (<configuration>)' {
9091
$result = Invoke-SentryServer {
9192
param([string]$url)
9293
RunIosApp -Dsn $url -TestArg "Managed"
@@ -97,9 +98,10 @@ Describe 'iOS app (<tfm>)' -ForEach @(
9798
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.ApplicationException`""
9899
# TODO: fix redundant SIGABRT (#3954)
99100
{ $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGABRT`"" } | Should -Throw
101+
{ $result.Envelopes() | Should -HaveCount 1 } | Should -Throw
100102
}
101103

102-
It 'captures native crash' {
104+
It 'captures native crash (<configuration>)' {
103105
$result = Invoke-SentryServer {
104106
param([string]$url)
105107
RunIosApp -Dsn $url -TestArg "Native"
@@ -109,9 +111,10 @@ Describe 'iOS app (<tfm>)' -ForEach @(
109111
$result.HasErrors() | Should -BeFalse
110112
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"EXC_[A-Z_]+`""
111113
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"System.\w+Exception`""
114+
$result.Envelopes() | Should -HaveCount 1
112115
}
113116

114-
It 'captures null reference exception' {
117+
It 'captures null reference exception (<configuration>)' {
115118
$result = Invoke-SentryServer {
116119
param([string]$url)
117120
RunIosApp -Dsn $url -TestArg "NullReferenceException"
@@ -120,7 +123,12 @@ Describe 'iOS app (<tfm>)' -ForEach @(
120123

121124
$result.HasErrors() | Should -BeFalse
122125
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.NullReferenceException`""
123-
# TODO: fix redundant EXC_BAD_ACCESS (#3954)
124-
{ $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"EXC_BAD_ACCESS`"" } | Should -Throw
126+
# TODO: fix redundant EXC_BAD_ACCESS in Release (#3954)
127+
if ($configuration -eq 'Release') {
128+
{ $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"EXC_BAD_ACCESS`"" } | Should -Throw
129+
} else {
130+
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"EXC_BAD_ACCESS`""
131+
$result.Envelopes() | Should -HaveCount 1
132+
}
125133
}
126134
}

integration-test/net9-maui/MainPage.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ protected override void OnAppearing()
3939

4040
SentrySdk.Close();
4141
#if ANDROID
42+
// prevent auto-restart
43+
Platform.CurrentActivity?.FinishAffinity();
4244
Process.KillProcess(Process.MyPid());
4345
#elif IOS
4446
System.Environment.Exit(0);

integration-test/net9-maui/MauiProgram.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ public static MauiApp CreateMauiApp()
1717
#endif
1818
options.Debug = false;
1919
options.DiagnosticLevel = SentryLevel.Error;
20+
// predictable crash envelopes only
21+
options.SendClientReports = false;
22+
options.AutoSessionTracking = false;
2023
})
2124
.ConfigureFonts(fonts =>
2225
{

integration-test/net9-maui/Platforms/Android/MainActivity.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ protected override void OnCreate(Bundle? savedInstanceState)
1818
{
1919
base.OnCreate(savedInstanceState);
2020

21+
System.Environment.SetEnvironmentVariable("SENTRY_DSN", Intent?.GetStringExtra("SENTRY_DSN"));
2122
System.Environment.SetEnvironmentVariable("SENTRY_TEST_ARG", Intent?.GetStringExtra("SENTRY_TEST_ARG"));
2223
}
2324
}

0 commit comments

Comments
 (0)