Skip to content

Commit cd67f52

Browse files
refactor: Change SentryFrame.function default from <redacted> to nil (#6608)
Co-authored-by: Philipp Hofmann <[email protected]>
1 parent 11853e6 commit cd67f52

File tree

9 files changed

+14
-22
lines changed

9 files changed

+14
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- Remove unused `SentryFrame.instruction` property (#6504)
2424
- Remove `uuid` and `name` of `SentryDebugMeta` (#6512) Use `debugID` instead of `uuid` and `codeFile` instead of `name`.
2525
- Enable enablePreWarmedAppStartTracing by default (#6508). With this option enabled, the SDK collects [prewarmed app starts](https://docs.sentry.io/platforms/apple/tracing/instrumentation/automatic-instrumentation/#prewarmed-app-start-tracing).
26+
- Set `SentryFrame.function` default to `nil` instead of `<redacted>` (#6608)
2627
- Change `value` and `type` of `SentryException` to be nullable (#6563)
2728
- Change the default trace context status to "ok" instead of "undefined" (#6611)
2829
- Remove `getHash` from SentryDsn (#6605)

Sources/Sentry/Public/SentryFrame.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ NS_SWIFT_NAME(Frame)
9999
@property (nonatomic, copy) NSDictionary<NSString *, id> *_Nullable vars;
100100

101101
- (instancetype)init;
102-
+ (instancetype)new NS_UNAVAILABLE;
103102

104103
@end
105104

Sources/Sentry/SentryFrame.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ @implementation SentryFrame
88

99
- (instancetype)init
1010
{
11-
if (self = [super init]) {
12-
self.function = @"<redacted>";
13-
}
11+
self = [super init];
1412
return self;
1513
}
1614

Tests/SentryTests/Integrations/MetricKit/SentryMetricKitIntegrationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ final class SentryMetricKitIntegrationTests: SentrySDKIntegrationTestsBase {
201201

202202
XCTAssertEqual(1, sentryFrames.count)
203203
let frame = sentryFrames.first
204-
XCTAssertEqual("<redacted>", frame?.function)
204+
XCTAssertNil(frame?.function)
205205
XCTAssertEqual("0x000000021f1a0001", frame?.imageAddress)
206206
XCTAssertEqual("libsystem_pthread.dylib", frame?.package)
207207
XCTAssertFalse(frame?.inApp?.boolValue ?? true)

Tests/SentryTests/Protocol/SentryFrameTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class SentryFrameTests: XCTestCase {
120120
// Assert
121121
XCTAssertNil(decoded.symbolAddress)
122122
XCTAssertNil(decoded.fileName)
123-
XCTAssertEqual("<redacted>", decoded.function)
123+
XCTAssertNil(decoded.function)
124124
XCTAssertNil(decoded.module)
125125
XCTAssertNil(decoded.lineNumber)
126126
XCTAssertNil(decoded.columnNumber)

Tests/SentryTests/SentryCrash/SentryCrashStackEntryMapperTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SentryCrashStackEntryMapperTests: XCTestCase {
4949
func testSymbolNameIsNull() {
5050
let frame = sut.mapStackEntry(with: SentryCrashStackCursor())
5151

52-
XCTAssertEqual("<redacted>", frame.function)
52+
XCTAssertNil(frame.function)
5353
}
5454

5555
func testSymbolName() {

Tests/SentryTests/SentryCrash/SentryDefaultThreadInspectorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class SentryDefaultThreadInspectorTests: XCTestCase {
220220

221221
XCTAssertNotNil(stackTrace)
222222
XCTAssertGreaterThan(stackTrace.frames.count, 0)
223-
XCTAssertEqual(stackTrace.frames.first?.function, "<redacted>")
223+
XCTAssertNil(stackTrace.frames.first?.function)
224224
}
225225

226226
func testOnlyCurrentThreadHasStacktrace() throws {

Tests/SentryTests/SentryCrashReportConverterTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ - (void)testNXPage
255255
[[SentryCrashReportConverter alloc] initWithReport:rawCrash inAppLogic:self.inAppLogic];
256256
SentryEvent *event = [reportConverter convertReportToEvent];
257257
SentryException *exception = event.exceptions.firstObject;
258-
XCTAssertEqualObjects(exception.stacktrace.frames.lastObject.function, @"<redacted>");
258+
XCTAssertNil(exception.stacktrace.frames.lastObject.function);
259259
}
260260

261261
- (void)testReactNative

Tests/SentryTests/SentryInterfacesTests.m

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ - (void)testFrame
2424
SentryFrame *frame = [[SentryFrame alloc] init];
2525
frame.symbolAddress = @"0x01";
2626
XCTAssertNotNil(frame.symbolAddress);
27-
NSDictionary *serialized = @{ @"symbol_addr" : @"0x01", @"function" : @"<redacted>" };
27+
NSDictionary *serialized = @{ @"symbol_addr" : @"0x01" };
2828
XCTAssertEqualObjects([frame serialize], serialized);
2929

3030
SentryFrame *frame2 = [[SentryFrame alloc] init];
@@ -223,10 +223,8 @@ - (void)testStacktrace
223223
XCTAssertNotNil(stacktrace.frames);
224224
XCTAssertNotNil(stacktrace.registers);
225225
[stacktrace fixDuplicateFrames];
226-
NSDictionary *serialized = @{
227-
@"frames" : @[ @{ @"symbol_addr" : @"0x01", @"function" : @"<redacted>" } ],
228-
@"registers" : @ { @"a" : @"1" }
229-
};
226+
NSDictionary *serialized =
227+
@{ @"frames" : @[ @{ @"symbol_addr" : @"0x01" } ], @"registers" : @ { @"a" : @"1" } };
230228
XCTAssertEqualObjects([stacktrace serialize], serialized);
231229
}
232230

@@ -251,10 +249,8 @@ - (void)testThread
251249
@"crashed" : @(YES),
252250
@"current" : @(NO),
253251
@"name" : @"name",
254-
@"stacktrace" : @ {
255-
@"frames" : @[ @{ @"symbol_addr" : @"0x01", @"function" : @"<redacted>" } ],
256-
@"registers" : @ { @"a" : @"1" }
257-
}
252+
@"stacktrace" :
253+
@ { @"frames" : @[ @{ @"symbol_addr" : @"0x01" } ], @"registers" : @ { @"a" : @"1" } }
258254
};
259255
XCTAssertEqualObjects([thread2 serialize], serialized2);
260256
}
@@ -344,10 +340,8 @@ - (void)testException
344340
@"value" : @"value",
345341
@"type" : @"type",
346342
@"thread_id" : @(2),
347-
@"stacktrace" : @ {
348-
@"frames" : @[ @{ @"symbol_addr" : @"0x01", @"function" : @"<redacted>" } ],
349-
@"registers" : @ { @"a" : @"1" }
350-
},
343+
@"stacktrace" :
344+
@ { @"frames" : @[ @{ @"symbol_addr" : @"0x01" } ], @"registers" : @ { @"a" : @"1" } },
351345
@"module" : @"module",
352346
@"mechanism" : @ { @"type" : @"test" }
353347
};

0 commit comments

Comments
 (0)