Skip to content

Commit bc52005

Browse files
itaybreNinjaLikesCheezsentry-junior[bot]romtsnphilprime
authored
feat: enable swiftAsyncStacktraces by default in v10 (#8718)
* feat: enable swiftAsyncStacktraces by default in v10 The feature was marked stable in v9.22.0. Enabling by default gives users stitched async stack traces out of the box. This impacts grouping, so it's gated to the major version. * chore: update changelog PR reference * fix: update LoadValidator error message (#8710) * perf(session-replay): Prefer in-memory frames for live encode (#8636) * perf(session-replay): Prefer in-memory frames for live encode Keep scaled UIImages for live video encode while still writing PNGs to disk for crash durability. Encode falls back to disk only for frames recovered after a crash, avoiding PNG readback on the streaming path. Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io> * meta: Link changelog entry to #8636 Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io> * ref(session-replay): Keep frame image loading off the data struct Move disk fallback out of SentryReplayFrame into image(for:) so the frame type stays a pure value without file I/O. * ref(session-replay): Load frame images through file manager Co-Authored-By: Phil Niedertscheider <phil.niedertscheider@sentry.io> * ci: Retrigger flaky full CI jobs Re-run after unrelated visionOS timeout, UI runner flake, and cancelled tvOS unit job on the previous head. Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io> Co-Authored-By: Itay Brenner <itay.brenner@sentry.io> Co-Authored-By: Phil Niedertscheider <phil.niedertscheider@sentry.io> * Update CHANGELOG with new features and improvements Added experimental option for UIViewController swizzling and improved Session Replay memory management. * ref(session-replay): Inline image(atPath:) static method Remove the thin static wrapper and use UIImage(contentsOfFile:) directly at call sites. Keep the original variable name in SentryVideoFrameProcessor to minimize diff. * ref(session-replay): Keep original variable name in OnDemandReplay --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io> Co-authored-by: Phil Niedertscheider <phil.niedertscheider@sentry.io> Co-authored-by: Itay Brenner <itay.brenner@sentry.io> Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com> * test: warn on clearTestState() usage via SwiftLint (#8706) * test: warn on clearTestState() usage via SwiftLint Add a warning-level custom rule flagging clearTestState() call sites so new usages get a second look. Existing call sites are suppressed with a note to reconsider if touched. * test: reword clearTestState() lint suppression note * test: suppress avoid_clear_test_state in NetworkTrackerIntegrationTestServerTests --------- Co-authored-by: NinjaLikesCheez <NinjaLikesCheez@users.noreply.github.com> * fix: stamp sentry-cocoa version in 3rd-party archives (#8699) * fix: stamp sentry-cocoa version in 3rd-party archives The 3rd-party integration archives were built before Craft bumped the version, so the tagged Package.swift contained the previous release's sentry-cocoa dependency. * test: assert version stamp in archive CI * fix: improve tar command in create_tgz_from_staging function Updated the tar command in the create_tgz_from_staging function to use tr for newline handling, ensuring compatibility with file names containing special characters. This change enhances the robustness of the archive creation process. * feat: enable logging by default in v10 (#8717) * feat: enable logging by default in v10 The logging spec v2.0.0 requires enableLogs to default to true. No logs are emitted unless the user explicitly calls SentrySDK.logger or enables a logging integration. * chore: update changelog PR reference * feat: enable swiftAsyncStacktraces by default in v10 The feature was marked stable in v9.22.0. Enabling by default gives users stitched async stack traces out of the box. This impacts grouping, so it's gated to the major version. * chore: update changelog PR reference * test: update default features for v10 async stacktraces Include swiftAsyncStacktraces in testDefaultFeatures expected list under SDK_V10, matching the new default. * chore: remove duplicate changelog entry * test: expect SwiftAsync integration in v10 tests --------- Co-authored-by: NinjaLikesCheez <NinjaLikesCheez@users.noreply.github.com> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io> Co-authored-by: Phil Niedertscheider <phil.niedertscheider@sentry.io> Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com> Co-authored-by: Philipp Süß <philipp.hofmann@sentry.io>
1 parent 87dbc38 commit bc52005

6 files changed

Lines changed: 37 additions & 4 deletions

File tree

CHANGELOG_V10.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
- Enable MetricKit integration by default (#8716)
2121
- Enable logging by default (#8717)
22+
- Enable `swiftAsyncStacktraces` by default (#8718)
2223
- Remove `sendDefaultPii`; use `dataCollection` to configure automatic data collection (#8253)
2324
- Remove Objective-C `@objc` attributes from SentrySDK (#8308)
2425
- Remove deprecated `locale` from device context; use `locale` in culture context instead (#8325)

Sources/Swift/Options.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,14 @@
645645
/// watchOS 8.0.
646646
///
647647
/// @brief Stitches the call to Swift Async functions in one consecutive stack trace.
648-
/// @note Default value is @c false.
649-
@objc public var swiftAsyncStacktraces: Bool = false
648+
/// @note Default value is @c true in v10, @c false in earlier versions.
649+
@objc public var swiftAsyncStacktraces: Bool = {
650+
#if SDK_V10
651+
return true
652+
#else
653+
return false
654+
#endif // SDK_V10
655+
}()
650656

651657
/// The path to store SDK data, like events, transactions, profiles, raw crash data, etc. We
652658
/// recommend only changing this when the default, e.g., in security environments, can't be accessed.

Tests/SentryTests/Helper/SentryEnabledFeaturesBuilderTests.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@ final class SentryEnabledFeaturesBuilderTests: XCTestCase {
1111
let features = SentryEnabledFeaturesBuilder.getEnabledFeatures(options: options)
1212

1313
// -- Assert --
14-
#if (os(iOS) || os(tvOS)) && !SENTRY_NO_UI_FRAMEWORK
15-
XCTAssertEqual(features, ["captureFailedRequests", "experimentalViewRenderer", "dataSwizzling", "metrics"])
14+
#if SDK_V10
15+
#if (os(iOS) || os(tvOS)) && !SENTRY_NO_UI_FRAMEWORK
16+
XCTAssertEqual(features, ["captureFailedRequests", "swiftAsyncStacktraces", "experimentalViewRenderer", "dataSwizzling", "metrics"])
17+
#else
18+
XCTAssertEqual(features, ["captureFailedRequests", "swiftAsyncStacktraces", "dataSwizzling", "metrics"])
19+
#endif
1620
#else
21+
#if (os(iOS) || os(tvOS)) && !SENTRY_NO_UI_FRAMEWORK
22+
XCTAssertEqual(features, ["captureFailedRequests", "experimentalViewRenderer", "dataSwizzling", "metrics"])
23+
#else
1724
XCTAssertEqual(features, ["captureFailedRequests", "dataSwizzling", "metrics"])
25+
#endif
1826
#endif
1927
}
2028

Tests/SentryTests/SentryClientTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,9 @@ final class SentryClientTests: XCTestCase {
21602160
#if os(iOS) || os(tvOS) || os(visionOS)
21612161
expectedIntegrations.append("FramesTracking")
21622162
#endif // os(iOS) || os(tvOS)
2163+
#if SDK_V10
2164+
expectedIntegrations.append("SwiftAsync")
2165+
#endif
21632166
#if canImport(MetricKit) && !os(tvOS) && SDK_V10
21642167
expectedIntegrations.append("MetricKit")
21652168
#endif

Tests/SentryTests/SentryOptionsTest.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,11 @@ - (void)assertDefaultValues:(SentryOptions *)options
796796
XCTAssertEqualObjects([[NSSet alloc] init], options.swizzleClassNameExcludes);
797797
XCTAssertEqual(YES, options.enableFileIOTracing);
798798
XCTAssertEqual(YES, options.enableAutoBreadcrumbTracking);
799+
#if SDK_V10
800+
XCTAssertTrue(options.swiftAsyncStacktraces);
801+
#else
799802
XCTAssertFalse(options.swiftAsyncStacktraces);
803+
#endif // SDK_V10
800804

801805
#if SENTRY_HAS_METRIC_KIT
802806
# if SDK_V10
@@ -1249,13 +1253,21 @@ - (void)testUrlSessionDelegate
12491253
- (void)testDefaultSwiftAsyncStacktraces
12501254
{
12511255
SentryOptions *options = [[SentryOptions alloc] init];
1256+
#if SDK_V10
1257+
XCTAssertTrue(options.swiftAsyncStacktraces);
1258+
#else
12521259
XCTAssertFalse(options.swiftAsyncStacktraces);
1260+
#endif // SDK_V10
12531261
}
12541262

12551263
- (void)testInitialSwiftAsyncStacktraces
12561264
{
12571265
SentryOptions *options = [self getValidOptions:@{ }];
1266+
#if SDK_V10
1267+
XCTAssertTrue(options.swiftAsyncStacktraces);
1268+
#else
12581269
XCTAssertFalse(options.swiftAsyncStacktraces);
1270+
#endif // SDK_V10
12591271
}
12601272

12611273
- (void)testInitialSwiftAsyncStacktracesYes

Tests/SentryTests/SentrySDKTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ class SentrySDKTests: XCTestCase {
145145
#else
146146
expectedIntegrations.append("SentryCrashIntegration")
147147
#endif
148+
#if SDK_V10
149+
expectedIntegrations.append("SentrySwiftAsyncIntegration")
150+
#endif
148151
#if canImport(MetricKit) && !os(tvOS) && SDK_V10
149152
expectedIntegrations.append("SentryMetricKitIntegration")
150153
#endif

0 commit comments

Comments
 (0)