Skip to content

Commit 25a5e8b

Browse files
Breaking: Remove stitchAsyncCode from SentryOption (#2973)
Removed stitchAsyncCode from SentryOption because it is not working Co-authored-by: Philipp Hofmann <[email protected]>
1 parent 381380f commit 25a5e8b

File tree

11 files changed

+12
-84
lines changed

11 files changed

+12
-84
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@
1616

1717
- Create User and Breadcrumb from map (#2820)
1818

19-
2019
### Fixes
2120

2221
- Improved performance serializing profiling data (#2863)
2322
- Possible crash in Core Data tracking (#2865)
2423
- Ensure the current GPU frame rate is always reported for concurrent transaction profiling metrics (#2929)
2524
- Move profiler metric collection to a background queue (#2956)
2625

26+
### Removed
27+
28+
- Remove experimental `stitchAsyncCode` from SentryOptions (#2973)
29+
30+
The `stitchAsyncCode` experimental option has been removed from `SentryOptions` as its behavior was unpredictable and sometimes resulted in unexpected errors. We plan to add it back once we fix it, but we don't have an ETA for it.
31+
2732
## 8.5.0
2833

2934
### Features

Sources/Sentry/Public/SentryOptions.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,6 @@ NS_SWIFT_NAME(Options)
162162
*/
163163
@property (nonatomic, assign) BOOL attachStacktrace;
164164

165-
/**
166-
* @warning This is an experimental feature and may still have bugs. Turning this feature on can
167-
* have an impact on the grouping of your issues.
168-
* @brief When enabled, the SDK stitches stack traces of asynchronous code together.
169-
* @note This feature is disabled by default.
170-
*/
171-
@property (nonatomic, assign) BOOL stitchAsyncCode;
172-
173165
/**
174166
* The maximum size for each attachment in bytes.
175167
* @note Default is 20 MiB (20 ✕ 1024 ✕ 1024 bytes).

Sources/Sentry/SentryClient.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,10 +688,6 @@ - (void)setSdk:(SentryEvent *)event
688688
[integrations addObject:trimmed];
689689
}
690690

691-
if (self.options.stitchAsyncCode) {
692-
[integrations addObject:@"StitchAsyncCode"];
693-
}
694-
695691
#if SENTRY_HAS_UIKIT
696692
if (self.options.enablePreWarmedAppStartTracing) {
697693
[integrations addObject:@"PreWarmedAppStartTracing"];

Sources/Sentry/SentryCrashIntegration.m

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ - (BOOL)installWithOptions:(nonnull SentryOptions *)options
8484

8585
[self startCrashHandler];
8686

87-
if (options.stitchAsyncCode) {
88-
[self.crashAdapter installAsyncHooks];
89-
}
90-
9187
[self configureScope];
9288

9389
return YES;
@@ -162,8 +158,6 @@ - (void)uninstall
162158
installationToken = 0;
163159
}
164160

165-
[self.crashAdapter uninstallAsyncHooks];
166-
167161
[NSNotificationCenter.defaultCenter removeObserver:self
168162
name:NSCurrentLocaleDidChangeNotification
169163
object:nil];

Sources/Sentry/SentryCrashWrapper.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ - (BOOL)isApplicationInForeground
5353

5454
- (void)installAsyncHooks
5555
{
56+
NSAssert(false,
57+
@"`installAsyncHooks` should not be called, as its behavior is unpredictable and sometimes "
58+
@"resulted in unexpected errors.");
5659
sentrycrash_install_async_hooks();
5760
}
5861

5962
- (void)uninstallAsyncHooks
6063
{
64+
NSAssert(false, @"`uninstallAsyncHooks` should not be called");
6165
sentrycrash_deactivate_async_hooks();
6266
}
6367

Sources/Sentry/SentryOptions.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ - (instancetype)init
7070
self.enableWatchdogTerminationTracking = YES;
7171
self.sessionTrackingIntervalMillis = [@30000 unsignedIntValue];
7272
self.attachStacktrace = YES;
73-
self.stitchAsyncCode = NO;
7473
self.maxAttachmentSize = 20 * 1024 * 1024;
7574
self.sendDefaultPii = NO;
7675
self.enableAutoPerformanceTracing = YES;
@@ -321,9 +320,6 @@ - (BOOL)validateOptions:(NSDictionary<NSString *, id> *)options
321320
[self setBool:options[@"attachStacktrace"]
322321
block:^(BOOL value) { self->_attachStacktrace = value; }];
323322

324-
[self setBool:options[@"stitchAsyncCode"]
325-
block:^(BOOL value) { self->_stitchAsyncCode = value; }];
326-
327323
if ([options[@"maxAttachmentSize"] isKindOfClass:[NSNumber class]]) {
328324
self.maxAttachmentSize = [options[@"maxAttachmentSize"] unsignedIntValue];
329325
}

Tests/SentryTests/Integrations/SentryCrash/SentryCrashIntegrationTests.swift

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -185,33 +185,7 @@ class SentryCrashIntegrationTests: NotificationCenterTestCase {
185185
XCTAssertNil(fileManager.readCurrentSession())
186186
XCTAssertNil(fileManager.readCrashedSession())
187187
}
188-
189-
func testInstall_WhenStitchAsyncCallsEnabled_CallsInstallAsyncHooks() {
190-
let sut = fixture.getSut()
191-
192-
let options = Options()
193-
options.stitchAsyncCode = true
194-
sut.install(with: options)
195-
196-
XCTAssertTrue(fixture.sentryCrash.installAsyncHooksCalled)
197-
}
198-
199-
func testInstall_WhenStitchAsyncCallsDisabled_DoesNotCallInstallAsyncHooks() {
200-
fixture.getSut().install(with: Options())
201-
202-
XCTAssertFalse(fixture.sentryCrash.installAsyncHooksCalled)
203-
}
204-
205-
func testUninstall_CallsUninstallAsyncHooks() {
206-
let sut = fixture.getSut()
207-
208-
sut.install(with: Options())
209-
210-
sut.uninstall()
211-
212-
XCTAssertTrue(fixture.sentryCrash.uninstallAsyncHooksCalled)
213-
}
214-
188+
215189
func testUninstall_DoesNotUpdateLocale_OnLocaleDidChangeNotification() {
216190
let (sut, hub) = givenSutWithGlobalHubAndCrashWrapper()
217191

Tests/SentryTests/SentryClientTests.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,12 +1133,6 @@ class SentryClientTest: XCTestCase {
11331133
}
11341134
}
11351135

1136-
func testTrackStitchAsyncCode() {
1137-
testFeatureTrackingAsIntegration(integrationName: "StitchAsyncCode") {
1138-
$0.stitchAsyncCode = true
1139-
}
1140-
}
1141-
11421136
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
11431137
func testTrackPreWarmedAppStartTracking() {
11441138
testFeatureTrackingAsIntegration(integrationName: "PreWarmedAppStartTracing") {

Tests/SentryTests/SentryCrash/SentryStacktraceBuilderTests.swift

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,7 @@ class SentryStacktraceBuilderTests: XCTestCase {
6767

6868
XCTAssertTrue(filteredFrames.count == 1, "The frames must be ordered from caller to callee, or oldest to youngest.")
6969
}
70-
71-
func testAsyncStacktraces() throws {
72-
SentrySDK.start { options in
73-
options.dsn = TestConstants.dsnAsString(username: "SentryStacktraceBuilderTests")
74-
options.stitchAsyncCode = true
75-
}
76-
77-
let expect = expectation(description: "testAsyncStacktraces")
78-
79-
fixture.queue.async {
80-
self.asyncFrame1(expect: expect)
81-
}
82-
83-
wait(for: [expect], timeout: 2)
84-
}
85-
70+
8671
func asyncFrame1(expect: XCTestExpectation) {
8772
fixture.queue.asyncAfter(deadline: DispatchTime.now()) {
8873
self.asyncFrame2(expect: expect)

Tests/SentryTests/SentryCrash/SentryThreadInspectorTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ class SentryThreadInspectorTests: XCTestCase {
3939
XCTAssertTrue(30 < stacktrace?.frames.count ?? 0, "Not enough stacktrace frames.")
4040
}
4141

42-
func testStacktraceHasFrames_forEveryThread_withStitchAsyncOn() {
43-
SentrySDK.start { $0.stitchAsyncCode = true }
44-
assertStackForEveryThread()
45-
}
46-
4742
func testStacktraceHasFrames_forEveryThread() {
4843
assertStackForEveryThread()
4944
}

0 commit comments

Comments
 (0)