Skip to content

Commit

Permalink
Merge branch 'main' into feat/hybrid-sdk-private-modulemap
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Nov 11, 2024
2 parents a5b1713 + 489fbb8 commit ca22e22
Show file tree
Hide file tree
Showing 67 changed files with 972 additions and 131 deletions.
2 changes: 1 addition & 1 deletion .github/last-release-runid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11685387200
11724928628
2 changes: 1 addition & 1 deletion .github/workflows/benchmarking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- 'Sources/**'

# test changes to benchmarking implementation
- 'Samples/iOS-Swift/iOS-Swift/**'
- 'Samples/iOS-Swift/**'
- 'Samples/iOS-Swift/PerformanceBenchmarks/**'
- '.github/workflows/benchmarking.yml'
- '.sauce/benchmarking-config.yml'
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

## Unreleased

### Features

- Transactions for crashes (#4504): Finish the transaction bound to the scope when the app crashes. This __experimental__ feature is disabled by default. You can enable it via the option `enablePersistingTracesWhenCrashing`.

### Fixes

- Keep PropagationContext when cloning scope (#4518)

## 8.40.1

### Fixes

- Session replay masking not working inside scroll view (#4498)

### Improvements

- Expose `Sentry._Hybrid` explicit module (#4440)
Expand All @@ -17,11 +31,13 @@
- Time-of-check time-of-use filesystem race condition (#4473)
- Capture all touches with session replay (#4477)


### Improvements

- Improve frames tracker performance (#4469)
- Log a warning when dropping envelopes due to rate-limiting (#4463)
- Expose `SentrySessionReplayIntegration-Hybrid.h` as `private` (#4486)
- Stops session replay if rate limiting is activated (#4496)
- Add `maskedViewClasses` and `unmaskedViewClasses` to SentryReplayOptions init via dict (#4492)
- Add `quality` to SentryReplayOptions init via dict (#4495)

Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ let package = Package(
targets: [
.binaryTarget(
name: "Sentry",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.40.0/Sentry.xcframework.zip",
checksum: "aa02c15ed98f2560436ccbcc0d25c848f2e8250c28c6c4a01ff3ac4231eb008b" //Sentry-Static
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.40.1/Sentry.xcframework.zip",
checksum: "db928e6fdc30de1aa97200576d86d467880df710cf5eeb76af23997968d7b2c7" //Sentry-Static
),
.binaryTarget(
name: "Sentry-Dynamic",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.40.0/Sentry-Dynamic.xcframework.zip",
checksum: "a24eeb1737a531d56c8b4ce6f63b2d1fb1a2a0fd05c4eb85a27ece8fe3e442b5" //Sentry-Dynamic
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.40.1/Sentry-Dynamic.xcframework.zip",
checksum: "31c55833e848a27100d38b607867bb5ce197d7183303b2c4d8ba4fa97d288df3" //Sentry-Dynamic
),
.target ( name: "SentrySwiftUI",
dependencies: ["Sentry", "SentryInternal"],
Expand Down
21 changes: 21 additions & 0 deletions Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1415,10 +1415,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "iOS-Swift/iOS-Swift.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 97JCY7859U;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 97JCY7859U;
INFOPLIST_FILE = "iOS-Swift/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -1428,6 +1430,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development io.sentry.sample.iOS-Swift";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SUPPORTS_MACCATALYST = YES;
SWIFT_OBJC_BRIDGING_HEADER = "iOS-Swift/Tools/iOS-Swift-Bridging-Header.h";
Expand Down Expand Up @@ -1629,10 +1632,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "iOS-Swift/iOS-Swift.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 97JCY7859U;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 97JCY7859U;
INFOPLIST_FILE = "iOS-Swift/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -1642,6 +1647,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development io.sentry.sample.iOS-Swift";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SUPPORTS_MACCATALYST = YES;
SWIFT_OBJC_BRIDGING_HEADER = "iOS-Swift/Tools/iOS-Swift-Bridging-Header.h";
Expand Down Expand Up @@ -1705,9 +1711,11 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "iOS-SwiftClip/iOS_SwiftClip.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 97JCY7859U;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 97JCY7859U;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "iOS-SwiftClip/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "iOS-Swift";
Expand All @@ -1726,6 +1734,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift.Clip";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift.Clip";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development io.sentry.sample.iOS-Swift.Clip";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -1861,10 +1870,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "iOS-Swift/iOS-Swift.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 97JCY7859U;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 97JCY7859U;
INFOPLIST_FILE = "iOS-Swift/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -1874,6 +1885,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development io.sentry.sample.iOS-Swift";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SUPPORTS_MACCATALYST = YES;
SWIFT_OBJC_BRIDGING_HEADER = "iOS-Swift/Tools/iOS-Swift-Bridging-Header.h";
Expand Down Expand Up @@ -1937,9 +1949,11 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "iOS-SwiftClip/iOS_SwiftClip.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 97JCY7859U;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 97JCY7859U;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "iOS-SwiftClip/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "iOS-Swift";
Expand All @@ -1958,6 +1972,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift.Clip";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift.Clip";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development io.sentry.sample.iOS-Swift.Clip";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -2107,9 +2122,11 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "iOS-SwiftClip/iOS_SwiftClip.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 97JCY7859U;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 97JCY7859U;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "iOS-SwiftClip/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "iOS-Swift";
Expand All @@ -2128,6 +2145,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift.Clip";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift.Clip";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development io.sentry.sample.iOS-Swift.Clip";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -2141,9 +2159,11 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "iOS-SwiftClip/iOS_SwiftClip.entitlements";
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 97JCY7859U;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 97JCY7859U;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "iOS-SwiftClip/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "iOS-Swift";
Expand All @@ -2162,6 +2182,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift.Clip";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match AppStore io.sentry.sample.iOS-Swift.Clip";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore io.sentry.sample.iOS-Swift.Clip";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
1 change: 1 addition & 0 deletions Samples/iOS-Swift/iOS-Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
options.enableSwizzling = !args.contains("--disable-swizzling")
options.enableCrashHandler = !args.contains("--disable-crash-handler")
options.enableTracing = !args.contains("--disable-tracing")
options.enablePersistingTracesWhenCrashing = true

// because we run CPU for 15 seconds at full throttle, we trigger ANR issues being sent. disable such during benchmarks.
options.enableAppHangTracking = !isBenchmarking && !args.contains("--disable-anr-tracking")
Expand Down
9 changes: 8 additions & 1 deletion Samples/iOS-Swift/iOS-Swift/ErrorsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ class ErrorsViewController: UIViewController {
}

@IBAction func crash(_ sender: UIButton) {
SentrySDK.crash()
let transaction = SentrySDK.startTransaction(name: "Crashing Transaction", operation: "ui.load", bindToScope: true)

transaction.startChild(operation: "operation explode")

DispatchQueue.global().asyncAfter(deadline: .now() + 0.1) {
transaction.startChild(operation: "operation crash")
SentrySDK.crash()
}
}

// swiftlint:disable force_unwrapping
Expand Down
2 changes: 1 addition & 1 deletion Samples/iOS-Swift/iOS-Swift/Sample.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 8.40.0
MARKETING_VERSION = 8.40.1
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class TableViewController: UITableViewController {

let w = 1.0 - (Double(indexPath.row) / 99)
cell.backgroundColor = UIColor(white: CGFloat(w), alpha: 1)
cell.textLabel?.text = "Row #\(indexPath.row)"

return cell
}
Expand Down
2 changes: 1 addition & 1 deletion Sentry.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Sentry"
s.version = "8.40.0"
s.version = "8.40.1"
s.summary = "Sentry client for cocoa"
s.homepage = "https://github.com/getsentry/sentry-cocoa"
s.license = "mit"
Expand Down
2 changes: 1 addition & 1 deletion SentryPrivate.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SentryPrivate"
s.version = "8.40.0"
s.version = "8.40.1"
s.summary = "Sentry Private Library."
s.homepage = "https://github.com/getsentry/sentry-cocoa"
s.license = "mit"
Expand Down
4 changes: 2 additions & 2 deletions SentrySwiftUI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SentrySwiftUI"
s.version = "8.40.0"
s.version = "8.40.1"
s.summary = "Sentry client for SwiftUI"
s.homepage = "https://github.com/getsentry/sentry-cocoa"
s.license = "mit"
Expand All @@ -19,5 +19,5 @@ Pod::Spec.new do |s|
s.watchos.framework = 'WatchKit'

s.source_files = "Sources/SentrySwiftUI/**/*.{swift,h,m}"
s.dependency 'Sentry', "8.40.0"
s.dependency 'Sentry', "8.40.1"
end
5 changes: 5 additions & 0 deletions SentryTestUtils/TestClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ public class TestClient: SentryClient {
return SentryId()
}

public var saveCrashTransactionInvocations = Invocations<(event: Event, scope: Scope)>()
public override func saveCrashTransaction(transaction: Transaction, scope: Scope) {
saveCrashTransactionInvocations.record((transaction, scope))
}

public var captureUserFeedbackInvocations = Invocations<UserFeedback>()
public override func capture(userFeedback: UserFeedback) {
captureUserFeedbackInvocations.record(userFeedback)
Expand Down
7 changes: 6 additions & 1 deletion SentryTestUtils/TestTransport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ import _SentryPrivate
import Foundation

public class TestTransport: NSObject, Transport {

public var sentEnvelopes = Invocations<SentryEnvelope>()
public func send(envelope: SentryEnvelope) {
sentEnvelopes.record(envelope)
}

public var storedEnvelopes = Invocations<SentryEnvelope>()
public func store(_ envelope: SentryEnvelope) {
storedEnvelopes.record(envelope)
}

public var recordLostEvents = Invocations<(category: SentryDataCategory, reason: SentryDiscardReason)>()
public func recordLostEvent(_ category: SentryDataCategory, reason: SentryDiscardReason) {
recordLostEvents.record((category, reason))
Expand Down
5 changes: 5 additions & 0 deletions SentryTestUtils/TestTransportAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public class TestTransportAdapter: SentryTransportAdapter {
public override func send(event: Event, traceContext: TraceContext?, attachments: [Attachment], additionalEnvelopeItems: [SentryEnvelopeItem]) {
sendEventWithTraceStateInvocations.record((event, traceContext, attachments, additionalEnvelopeItems))
}

public var storeEventInvocations = Invocations<(event: Event, traceContext: TraceContext?)>()
public override func store(_ event: Event, traceContext: TraceContext?) {
storeEventInvocations.record((event, traceContext))
}

public var userFeedbackInvocations = Invocations<UserFeedback>()
public override func send(userFeedback: UserFeedback) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Configuration/SDK.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DYLIB_INSTALL_NAME_BASE = @rpath
MACH_O_TYPE = mh_dylib
FRAMEWORK_VERSION = A

CURRENT_PROJECT_VERSION = 8.40.0
CURRENT_PROJECT_VERSION = 8.40.1

ALWAYS_SEARCH_USER_PATHS = NO
CLANG_ENABLE_OBJC_ARC = YES
Expand Down
2 changes: 1 addition & 1 deletion Sources/Configuration/SentrySwiftUI.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PRODUCT_NAME = SentrySwiftUI
CURRENT_PROJECT_VERSION = 8.40.0
CURRENT_PROJECT_VERSION = 8.40.1

MACOSX_DEPLOYMENT_TARGET = 10.15
IPHONEOS_DEPLOYMENT_TARGET = 13.0
Expand Down
10 changes: 0 additions & 10 deletions Sources/Sentry/Public/SentryDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,6 @@ typedef NSNumber *_Nullable (^SentryTracesSamplerCallback)(
*/
typedef void (^SentrySpanCallback)(id<SentrySpan> _Nullable span);

/**
* A callback block which gets called right before a metric is about to be emitted.
* @param key The key of the metric.
* @param tags A dictionary of key-value pairs associated with the metric.
* @return BOOL YES if the metric should be emitted, NO otherwise.
*/
typedef BOOL (^SentryBeforeEmitMetricCallback)(
NSString *_Nonnull key, NSDictionary<NSString *, NSString *> *_Nonnull tags);

/**
* Log level.
*/
Expand Down
11 changes: 11 additions & 0 deletions Sources/Sentry/Public/SentryOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,17 @@ NS_SWIFT_NAME(Options)
*/
@property (nonatomic, assign) BOOL enablePerformanceV2;

/**
* @warning This is an experimental feature and may still have bugs.
*
* When enabled, the SDK finishes the ongoing transaction bound to the scope and links them to the
* crash event when your app crashes. The SDK skips adding profiles to increase the chance of
* keeping the transaction.
*
* @note The default is @c NO .
*/
@property (nonatomic, assign) BOOL enablePersistingTracesWhenCrashing;

/**
* A block that configures the initial scope when starting the SDK.
* @discussion The block receives a suggested default scope. You can either
Expand Down
Loading

0 comments on commit ca22e22

Please sign in to comment.