Skip to content
Draft
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
16 changes: 5 additions & 11 deletions integration-test/ios.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ Describe 'iOS app (<tfm>, <configuration>)' -ForEach @(

$result.HasErrors() | Should -BeFalse
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.ApplicationException`""
# TODO: fix redundant SIGABRT (#3954)
{ $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"SIGABRT`"" } | Should -Throw
{ $result.Envelopes() | Should -HaveCount 1 } | Should -Throw
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"(EXC_[A-Z_]+|SIG[A-Z]+)`""
$result.Envelopes() | Should -HaveCount 1
}

It 'captures native crash (<configuration>)' {
Expand All @@ -112,7 +111,7 @@ Describe 'iOS app (<tfm>, <configuration>)' -ForEach @(
}

$result.HasErrors() | Should -BeFalse
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"EXC_[A-Z_]+`""
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"(EXC_[A-Z_]+|SIG[A-Z]+)`""
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"System.\w+Exception`""
$result.Envelopes() | Should -HaveCount 1
}
Expand All @@ -126,12 +125,7 @@ Describe 'iOS app (<tfm>, <configuration>)' -ForEach @(

$result.HasErrors() | Should -BeFalse
$result.Envelopes() | Should -AnyElementMatch "`"type`":`"System.NullReferenceException`""
# TODO: fix redundant EXC_BAD_ACCESS in Release (#3954)
if ($configuration -eq 'Release') {
{ $result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"EXC_BAD_ACCESS`"" } | Should -Throw
} else {
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"EXC_BAD_ACCESS`""
$result.Envelopes() | Should -HaveCount 1
}
$result.Envelopes() | Should -Not -AnyElementMatch "`"type`":`"(EXC_[A-Z_]+|SIG[A-Z]+)`""
$result.Envelopes() | Should -HaveCount 1
}
}
2 changes: 1 addition & 1 deletion modules/sentry-cocoa
Submodule sentry-cocoa updated 58 files
+1 −1 .github/last-release-runid
+1 −1 .github/workflows/analyze-language-trends.yml
+1 −1 .github/workflows/assemble-xcframework-variant.yml
+1 −1 .github/workflows/benchmarking.yml
+1 −1 .github/workflows/build.yml
+1 −1 .github/workflows/integration-test.yml
+1 −1 .github/workflows/lint-cocoapods-specs.yml
+1 −1 .github/workflows/objc-conversion-analysis.yml
+1 −1 .github/workflows/release.yml
+1 −1 .github/workflows/size-analysis.yml
+1 −1 .github/workflows/test-cross-platform.yml
+1 −1 .github/workflows/testflight.yml
+2 −2 .github/workflows/ui-tests-common.yml
+2 −2 .github/workflows/unit-test-common.yml
+1 −1 3rd-party-integrations/SentryCocoaLumberjack/Package.swift
+1 −1 3rd-party-integrations/SentryPulse/Package.swift
+1 −1 3rd-party-integrations/SentrySwiftLog/Package.swift
+1 −1 3rd-party-integrations/SentrySwiftyBeaver/Package.swift
+14 −0 CHANGELOG.md
+2 −2 Gemfile.lock
+10 −10 Package.swift
+10 −10 Package@swift-6.1.swift
+1 −1 Sentry.podspec
+2 −2 SentrySwiftUI.podspec
+1 −1 Sources/Configuration/SDK.xcconfig
+1 −1 Sources/Configuration/SentrySwiftUI.xcconfig
+1 −1 Sources/Configuration/Versioning.xcconfig
+6 −0 Sources/Sentry/PrivateSentrySDKOnly.m
+10 −0 Sources/Sentry/Public/PrivateSentrySDKOnly.h
+16 −0 Sources/Sentry/Public/SentryBaggage.h
+5 −0 Sources/Sentry/Public/SentryTraceContext.h
+30 −1 Sources/Sentry/SentryBaggage.m
+1 −1 Sources/Sentry/SentryMeta.m
+7 −0 Sources/Sentry/SentryOptionsInternal.m
+3 −1 Sources/Sentry/SentrySDKInternal.m
+38 −5 Sources/Sentry/SentryTraceContext.m
+9 −0 Sources/Sentry/include/SentryCrashC.h
+6 −0 Sources/Sentry/include/SentryCrashMonitor_Signal.h
+14 −0 Sources/Sentry/include/SentryTraceContext+Private.h
+3 −1 Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor.c
+7 −0 Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_MachException.c
+50 −3 Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_Signal.c
+22 −0 Sources/SentryCrash/Recording/SentryCrashC.c
+25 −10 Sources/Swift/Core/Tools/ViewCapture/SentryDefaultMaskRenderer.swift
+29 −0 Sources/Swift/Options.swift
+17 −0 Sources/Swift/SentryDsn.swift
+56 −2 Sources/Swift/State/SentryPropagationContext.swift
+1 −1 Tests/SentryTests/Helper/EnvelopeComparison.swift
+61 −0 Tests/SentryTests/Networking/SentryDsnOrgIdTests.swift
+4 −1 Tests/SentryTests/OptionsInSyncWithDocs/SentryOptionsDocumentationSyncTests.swift
+53 −0 Tests/SentryTests/SentryOptionsTest.m
+48 −0 Tests/SentryTests/Transaction/SentryBaggageTests.swift
+176 −0 Tests/SentryTests/Transaction/SentryStrictTraceContinuationTests.swift
+141 −3 Tests/SentryTests/Transaction/SentryTraceContextTests.swift
+44 −0 Tests/SentryTests/ViewCapture/SentryViewPhotographerTests.swift
+26 −0 develop-docs/SENTRYCRASH.md
+1 −1 scripts/.clang-format-version
+487 −0 sdk_api.json
9 changes: 6 additions & 3 deletions scripts/build-sentry-cocoa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ xcodebuild archive -project Sentry.xcodeproj \
-sdk "$ios_sdk" \
-archivePath ./Carthage/output-ios.xcarchive \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
GCC_PREPROCESSOR_DEFINITIONS='$(inherited) SENTRY_CRASH_MANAGED_RUNTIME=1'
./scripts/remove-architectures.sh ./Carthage/output-ios.xcarchive arm64e
xcodebuild archive -project Sentry.xcodeproj \
-scheme Sentry \
-configuration Release \
-sdk "$ios_simulator_sdk" \
-archivePath ./Carthage/output-iossimulator.xcarchive \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
GCC_PREPROCESSOR_DEFINITIONS='$(inherited) SENTRY_CRASH_MANAGED_RUNTIME=1'
xcodebuild -create-xcframework \
-framework ./Carthage/output-ios.xcarchive/Products/Library/Frameworks/Sentry.framework \
-framework ./Carthage/output-iossimulator.xcarchive/Products/Library/Frameworks/Sentry.framework \
Expand All @@ -73,7 +75,8 @@ xcodebuild archive -project Sentry.xcodeproj \
-destination 'generic/platform=macOS,variant=Mac Catalyst' \
-archivePath ./Carthage/output-maccatalyst.xcarchive \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
GCC_PREPROCESSOR_DEFINITIONS='$(inherited) SENTRY_CRASH_MANAGED_RUNTIME=1'
./scripts/remove-architectures.sh ./Carthage/output-maccatalyst.xcarchive arm64e
xcodebuild -create-xcframework \
-framework ./Carthage/output-maccatalyst.xcarchive/Products/Library/Frameworks/Sentry.framework \
Expand Down
33 changes: 33 additions & 0 deletions src/Sentry.Bindings.Cocoa/ApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ interface SentryBaggage
[NullAllowed, Export("replayId", ArgumentSemantic.Strong)]
string ReplayId { get; set; }

// @property (readonly, nonatomic) NSString * _Nullable orgId;
[NullAllowed, Export("orgId")]
string OrgId { get; }

// -(instancetype _Nonnull)initWithTraceId:(SentryId * _Nonnull)traceId publicKey:(NSString * _Nonnull)publicKey releaseName:(NSString * _Nullable)releaseName environment:(NSString * _Nullable)environment transaction:(NSString * _Nullable)transaction sampleRate:(NSString * _Nullable)sampleRate sampled:(NSString * _Nullable)sampled replayId:(NSString * _Nullable)replayId;
[Export("initWithTraceId:publicKey:releaseName:environment:transaction:sampleRate:sampled:replayId:")]
NativeHandle Constructor(SentryId traceId, string publicKey, [NullAllowed] string releaseName, [NullAllowed] string environment, [NullAllowed] string transaction, [NullAllowed] string sampleRate, [NullAllowed] string sampled, [NullAllowed] string replayId);
Expand All @@ -166,6 +170,10 @@ interface SentryBaggage
[Export("initWithTraceId:publicKey:releaseName:environment:transaction:sampleRate:sampleRand:sampled:replayId:")]
NativeHandle Constructor(SentryId traceId, string publicKey, [NullAllowed] string releaseName, [NullAllowed] string environment, [NullAllowed] string transaction, [NullAllowed] string sampleRate, [NullAllowed] string sampleRand, [NullAllowed] string sampled, [NullAllowed] string replayId);

// -(instancetype _Nonnull)initWithTraceId:(SentryId * _Nonnull)traceId publicKey:(NSString * _Nonnull)publicKey releaseName:(NSString * _Nullable)releaseName environment:(NSString * _Nullable)environment transaction:(NSString * _Nullable)transaction sampleRate:(NSString * _Nullable)sampleRate sampleRand:(NSString * _Nullable)sampleRand sampled:(NSString * _Nullable)sampled replayId:(NSString * _Nullable)replayId orgId:(NSString * _Nullable)orgId;
[Export("initWithTraceId:publicKey:releaseName:environment:transaction:sampleRate:sampleRand:sampled:replayId:orgId:")]
NativeHandle Constructor(SentryId traceId, string publicKey, [NullAllowed] string releaseName, [NullAllowed] string environment, [NullAllowed] string transaction, [NullAllowed] string sampleRate, [NullAllowed] string sampleRand, [NullAllowed] string sampled, [NullAllowed] string replayId, [NullAllowed] string orgId);

// -(NSString * _Nonnull)toHTTPHeaderWithOriginalBaggage:(NSDictionary * _Nullable)originalBaggage;
[Export("toHTTPHeaderWithOriginalBaggage:")]
string ToHTTPHeaderWithOriginalBaggage([NullAllowed] NSDictionary originalBaggage);
Expand Down Expand Up @@ -1368,6 +1376,10 @@ interface SentryTraceContext : SentrySerializable
[NullAllowed, Export("replayId")]
string ReplayId { get; }

// @property (readonly, nonatomic) NSString * _Nullable orgId;
[NullAllowed, Export("orgId")]
string OrgId { get; }

// -(SentryBaggage * _Nonnull)toBaggage;
[Export("toBaggage")]
SentryBaggage ToBaggage();
Expand Down Expand Up @@ -1656,6 +1668,11 @@ interface PrivateSentrySDKOnly
[Static]
[Export("setLogOutput:")]
void SetLogOutput(Action<NSString> output);

// +(void)ignoreNextSignal:(int)signum;
[Static]
[Export("ignoreNextSignal:")]
void IgnoreNextSignal(int signum);
}

// @interface SentryOptions : NSObject
Expand Down Expand Up @@ -1987,6 +2004,18 @@ interface SentryOptions
[Export("spotlightUrl")]
string SpotlightUrl { get; set; }

// @property (nonatomic) BOOL strictTraceContinuation;
[Export("strictTraceContinuation")]
bool StrictTraceContinuation { get; set; }

// @property (copy, nonatomic) NSString * _Nullable orgId;
[NullAllowed, Export("orgId")]
string OrgId { get; set; }

// @property (readonly, copy, nonatomic) NSString * _Nullable effectiveOrgId;
[NullAllowed, Export("effectiveOrgId")]
string EffectiveOrgId { get; }

// @property (nonatomic, strong) SentryExperimentalOptions * _Nonnull experimental;
[Export("experimental", ArgumentSemantic.Strong)]
SentryExperimentalOptions Experimental { get; set; }
Expand Down Expand Up @@ -2129,6 +2158,10 @@ interface SentryDsn
// -(NSURL * _Nonnull)getEnvelopeEndpoint __attribute__((warn_unused_result("")));
[Export("getEnvelopeEndpoint")]
NSUrl EnvelopeEndpoint { get; }

// @property (readonly, copy, nonatomic) NSString * _Nullable orgId;
[NullAllowed, Export("orgId")]
string OrgId { get; }
}

// @interface SentryExperimentalOptions : NSObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ internal void Handle(object sender, MarshalManagedExceptionEventArgs e)

// This is likely a terminal exception so try to send the crash report before shutting down
_hub?.Flush();

// The Xamarin runtime will call abort() after this handler returns, which raises
// SIGABRT. Tell SentryCrash to ignore it on this thread so we don't get a duplicate
// native crash event for a managed exception we've already captured.
const int SIGABRT = 6;
SentryCocoaHybridSdk.IgnoreNextSignal(SIGABRT);
}
}
}
Loading