Skip to content

Commit 5b5efea

Browse files
authored
ref: Rename SentryMechanismMeta to SentryMechanismMetaInformation (#6607)
* ref: Rename SentryMechanismMeta to SentryMechanismContext Renames SentryMechanismMeta to SentryMechanismContext to resolve naming conflicts with Kotlin Multiplatform's metaprogramming features. Changes: - Rename class from SentryMechanismMeta to SentryMechanismContext - Update Swift name from MechanismMeta to MechanismContext - Update all imports and references across the codebase - Rename test files and update test class names - Update Xcode project and SDK API files Closes #2888 * update public api * renamed from MechanismContext to MechanismMetaInformation * refactor: Change SentryMechanismMetaInformation to SentryMechanismContext * Update CHANGELOG.md
1 parent b1e357f commit 5b5efea

17 files changed

+72
-71
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
- Add layer class filtering for views used in multiple contexts (e.g., SwiftUI._UIGraphicsView)
5353
- Improve transform calculations for views with custom anchor points
5454
- Fix axis-aligned transform detection for optimized opaque view clipping
55+
- Rename `SentryMechanismMeta` to `SentryMechanismContext` to resolve Kotlin Multi-Platform build errors (#6607)
5556
- Fix conversion of frame rate to time interval for session replay (#6623)
5657

5758
### Improvements

Sentry.xcodeproj/project.pbxproj

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
62F05D2B2C0DB1F100916E3F /* SentryLogTestHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 62F05D2A2C0DB1F100916E3F /* SentryLogTestHelper.m */; };
144144
62F226B729A37C120038080D /* SentryBooleanSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 62F226B629A37C120038080D /* SentryBooleanSerialization.m */; };
145145
62F4DDA12C04CB9700588890 /* SentryBaggageSerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62F4DDA02C04CB9700588890 /* SentryBaggageSerializationTests.swift */; };
146-
62F70E932D4234B800634054 /* SentryMechanismMetaCodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62F70E922D4234B100634054 /* SentryMechanismMetaCodable.swift */; };
146+
62F70E932D4234B800634054 /* SentryMechanismContextCodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62F70E922D4234B100634054 /* SentryMechanismContextCodable.swift */; };
147147
62F70E952D423BCD00634054 /* SentryMechanismCodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62F70E942D423BCA00634054 /* SentryMechanismCodable.swift */; };
148148
62FC69362BEDFF18002D3EF2 /* SentryLogExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62FC69352BEDFF18002D3EF2 /* SentryLogExtensions.swift */; };
149149
6304360A1EC0595B00C4D3FA /* SentryNSDataUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 630436081EC0595B00C4D3FA /* SentryNSDataUtils.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -529,9 +529,9 @@
529529
7BE912AD272162D900E49E62 /* SentryNoOpSpan.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BE912AC272162D900E49E62 /* SentryNoOpSpan.m */; };
530530
7BE912AF272166DD00E49E62 /* SentryNoOpSpanTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BE912AE272166DD00E49E62 /* SentryNoOpSpanTests.swift */; };
531531
7BE912B12721C76000E49E62 /* SentryPerformanceTrackingIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BE912B02721C76000E49E62 /* SentryPerformanceTrackingIntegrationTests.swift */; };
532-
7BECF42226145C5D00D9826E /* SentryMechanismMeta.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BECF42126145C5D00D9826E /* SentryMechanismMeta.h */; settings = {ATTRIBUTES = (Public, ); }; };
533-
7BECF42826145CD900D9826E /* SentryMechanismMeta.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BECF42726145CD900D9826E /* SentryMechanismMeta.m */; };
534-
7BECF432261463E600D9826E /* SentryMechanismMetaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BECF431261463E600D9826E /* SentryMechanismMetaTests.swift */; };
532+
7BECF42226145C5D00D9826E /* SentryMechanismContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BECF42126145C5D00D9826E /* SentryMechanismContext.h */; settings = {ATTRIBUTES = (Public, ); }; };
533+
7BECF42826145CD900D9826E /* SentryMechanismContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BECF42726145CD900D9826E /* SentryMechanismContext.m */; };
534+
7BECF432261463E600D9826E /* SentryMechanismContextTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BECF431261463E600D9826E /* SentryMechanismContextTests.swift */; };
535535
7BEF4957270C4B9D00F8F30E /* SentryUIViewControllerSwizzlingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BEF4956270C4B9D00F8F30E /* SentryUIViewControllerSwizzlingTests.swift */; };
536536
7BF536D124BDF3E7004FA6A2 /* SentryEnvelopeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BF536D024BDF3E7004FA6A2 /* SentryEnvelopeTests.swift */; };
537537
7BF536D424BEF255004FA6A2 /* SentryAssertions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BF536D324BEF255004FA6A2 /* SentryAssertions.swift */; };
@@ -1425,7 +1425,7 @@
14251425
62F226B629A37C120038080D /* SentryBooleanSerialization.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryBooleanSerialization.m; sourceTree = "<group>"; };
14261426
62F226B829A37C270038080D /* SentryBooleanSerialization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryBooleanSerialization.h; sourceTree = "<group>"; };
14271427
62F4DDA02C04CB9700588890 /* SentryBaggageSerializationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryBaggageSerializationTests.swift; sourceTree = "<group>"; };
1428-
62F70E922D4234B100634054 /* SentryMechanismMetaCodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryMechanismMetaCodable.swift; sourceTree = "<group>"; };
1428+
62F70E922D4234B100634054 /* SentryMechanismContextCodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryMechanismContextCodable.swift; sourceTree = "<group>"; };
14291429
62F70E942D423BCA00634054 /* SentryMechanismCodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryMechanismCodable.swift; sourceTree = "<group>"; };
14301430
62FC69352BEDFF18002D3EF2 /* SentryLogExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryLogExtensions.swift; sourceTree = "<group>"; };
14311431
630436081EC0595B00C4D3FA /* SentryNSDataUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryNSDataUtils.h; path = include/SentryNSDataUtils.h; sourceTree = "<group>"; };
@@ -1851,9 +1851,9 @@
18511851
7BE912AC272162D900E49E62 /* SentryNoOpSpan.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryNoOpSpan.m; sourceTree = "<group>"; };
18521852
7BE912AE272166DD00E49E62 /* SentryNoOpSpanTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryNoOpSpanTests.swift; sourceTree = "<group>"; };
18531853
7BE912B02721C76000E49E62 /* SentryPerformanceTrackingIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryPerformanceTrackingIntegrationTests.swift; sourceTree = "<group>"; };
1854-
7BECF42126145C5D00D9826E /* SentryMechanismMeta.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryMechanismMeta.h; path = Public/SentryMechanismMeta.h; sourceTree = "<group>"; };
1855-
7BECF42726145CD900D9826E /* SentryMechanismMeta.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryMechanismMeta.m; sourceTree = "<group>"; };
1856-
7BECF431261463E600D9826E /* SentryMechanismMetaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryMechanismMetaTests.swift; sourceTree = "<group>"; };
1854+
7BECF42126145C5D00D9826E /* SentryMechanismContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryMechanismContext.h; path = Public/SentryMechanismContext.h; sourceTree = "<group>"; };
1855+
7BECF42726145CD900D9826E /* SentryMechanismContext.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryMechanismContext.m; sourceTree = "<group>"; };
1856+
7BECF431261463E600D9826E /* SentryMechanismContextTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryMechanismContextTests.swift; sourceTree = "<group>"; };
18571857
7BEF4956270C4B9D00F8F30E /* SentryUIViewControllerSwizzlingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryUIViewControllerSwizzlingTests.swift; sourceTree = "<group>"; };
18581858
7BF536D024BDF3E7004FA6A2 /* SentryEnvelopeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryEnvelopeTests.swift; sourceTree = "<group>"; };
18591859
7BF536D324BEF255004FA6A2 /* SentryAssertions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryAssertions.swift; sourceTree = "<group>"; };
@@ -2633,7 +2633,7 @@
26332633
6281C5712D3E4F06009D0978 /* DecodeArbitraryData.swift */,
26342634
623FD9012D3FA5DA00803EDA /* SentryFrameCodable.swift */,
26352635
6293F5742D422A8A002BC3BD /* SentryStacktraceCodable.swift */,
2636-
62F70E922D4234B100634054 /* SentryMechanismMetaCodable.swift */,
2636+
62F70E922D4234B100634054 /* SentryMechanismContextCodable.swift */,
26372637
62F70E942D423BCA00634054 /* SentryMechanismCodable.swift */,
26382638
620467AB2D3FFD1C0025F06C /* SentryNSErrorCodable.swift */,
26392639
620078712D38F00D0022CB67 /* SentryGeoCodable.swift */,
@@ -2769,8 +2769,8 @@
27692769
639FCF9F1EBC804600778193 /* SentryException.m */,
27702770
6334313F20AD9AE40077E581 /* SentryMechanism.h */,
27712771
6334314020AD9AE40077E581 /* SentryMechanism.m */,
2772-
7BECF42126145C5D00D9826E /* SentryMechanismMeta.h */,
2773-
7BECF42726145CD900D9826E /* SentryMechanismMeta.m */,
2772+
7BECF42126145C5D00D9826E /* SentryMechanismContext.h */,
2773+
7BECF42726145CD900D9826E /* SentryMechanismContext.m */,
27742774
7B3B472F25D6CBFC00D01640 /* SentryNSError.h */,
27752775
7B3B473725D6CC7E00D01640 /* SentryNSError.m */,
27762776
639FCFA61EBC80CC00778193 /* SentryFrame.h */,
@@ -3454,7 +3454,7 @@
34543454
7BC6EC07255C36DE0059822A /* SentryStacktraceTests.swift */,
34553455
7BC6EC0B255C3DF80059822A /* SentryThreadTests.swift */,
34563456
7BC6EC0F255C3F560059822A /* SentryMechanismTests.swift */,
3457-
7BECF431261463E600D9826E /* SentryMechanismMetaTests.swift */,
3457+
7BECF431261463E600D9826E /* SentryMechanismContextTests.swift */,
34583458
7B3B473D25D6CEA500D01640 /* SentryNSErrorTests.swift */,
34593459
7BC6EC13255C415E0059822A /* SentryExceptionTests.swift */,
34603460
7BC6EC17255C44540059822A /* SentryDebugMetaTests.swift */,
@@ -5095,7 +5095,7 @@
50955095
63FE715D20DA4C1100CDBAE8 /* SentryCrashSymbolicator.h in Headers */,
50965096
FAE2DABA2E1F318900262307 /* SentryProfilingSwiftHelpers.h in Headers */,
50975097
D8ACE3CF2762187D00F5A213 /* SentryFileIOTrackingIntegration.h in Headers */,
5098-
7BECF42226145C5D00D9826E /* SentryMechanismMeta.h in Headers */,
5098+
7BECF42226145C5D00D9826E /* SentryMechanismContext.h in Headers */,
50995099
63FE718920DA4C1100CDBAE8 /* SentryCrash.h in Headers */,
51005100
7B56D73124616CCD00B842DA /* SentryConcurrentRateLimitsDictionary.h in Headers */,
51015101
D456B4322D706BDF007068CB /* SentrySpanOperation.h in Headers */,
@@ -5836,7 +5836,7 @@
58365836
63FE710720DA4C1000CDBAE8 /* SentryCrashStackCursor_SelfThread.m in Sources */,
58375837
63FE711120DA4C1000CDBAE8 /* SentryCrashDebug.c in Sources */,
58385838
7B883F49253D714C00879E62 /* SentryCrashUUIDConversion.c in Sources */,
5839-
62F70E932D4234B800634054 /* SentryMechanismMetaCodable.swift in Sources */,
5839+
62F70E932D4234B800634054 /* SentryMechanismContextCodable.swift in Sources */,
58405840
843FB3232D0CD04D00558F18 /* SentryUserAccess.m in Sources */,
58415841
63FE716720DA4C1100CDBAE8 /* SentryCrashCPU.c in Sources */,
58425842
63FE717320DA4C1100CDBAE8 /* SentryCrashC.c in Sources */,
@@ -5864,7 +5864,7 @@
58645864
7B56D73324616D9500B842DA /* SentryConcurrentRateLimitsDictionary.m in Sources */,
58655865
8ECC674825C23A20000E2BF6 /* SentryTransaction.m in Sources */,
58665866
D8CAC02E2BA0663E00E38F34 /* SentryReplayOptions.swift in Sources */,
5867-
7BECF42826145CD900D9826E /* SentryMechanismMeta.m in Sources */,
5867+
7BECF42826145CD900D9826E /* SentryMechanismContext.m in Sources */,
58685868
8E7C982F2693D56000E6336C /* SentryTraceHeader.m in Sources */,
58695869
F429D39A2E85360F00DBF387 /* RetryAfterHeaderParser.swift in Sources */,
58705870
63FE715F20DA4C1100CDBAE8 /* SentryCrashID.c in Sources */,
@@ -6196,7 +6196,7 @@
61966196
D4D0E1E82E9D040A00358814 /* SentrySessionReplayEnvironmentCheckerTests.swift in Sources */,
61976197
33042A1729DC2C4300C60085 /* SentryExtraContextProviderTests.swift in Sources */,
61986198
D8137D54272B53070082656C /* TestSentrySpan.m in Sources */,
6199-
7BECF432261463E600D9826E /* SentryMechanismMetaTests.swift in Sources */,
6199+
7BECF432261463E600D9826E /* SentryMechanismContextTests.swift in Sources */,
62006200
7BE8E8462593313500C4DA1F /* SentryAttachment+Equality.m in Sources */,
62016201
D80694C72B7CD22B00B820E6 /* SentryReplayRecordingTests.swift in Sources */,
62026202
63FE721F20DA66EC00CDBAE8 /* SentryCrashSignalInfo_Tests.m in Sources */,

Sources/Sentry/Public/Sentry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[];
2727
# import <Sentry/SentryIntegrationProtocol.h>
2828
# import <Sentry/SentryMeasurementUnit.h>
2929
# import <Sentry/SentryMechanism.h>
30-
# import <Sentry/SentryMechanismMeta.h>
30+
# import <Sentry/SentryMechanismContext.h>
3131
# import <Sentry/SentryMessage.h>
3232
# import <Sentry/SentryNSError.h>
3333
# import <Sentry/SentryOptions.h>

Sources/Sentry/Public/SentryMechanism.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
NS_ASSUME_NONNULL_BEGIN
1212

1313
@class SentryNSError;
14-
@class SentryMechanismMeta;
14+
@class SentryMechanismContext;
1515

1616
NS_SWIFT_NAME(Mechanism)
1717
@interface SentryMechanism : NSObject <SentrySerializable>
@@ -58,7 +58,7 @@ SENTRY_NO_INIT
5858
* Information from the operating system or runtime on the exception
5959
* mechanism.
6060
*/
61-
@property (nullable, nonatomic, strong) SentryMechanismMeta *meta;
61+
@property (nullable, nonatomic, strong) SentryMechanismContext *meta;
6262

6363
/**
6464
* Initialize an SentryMechanism with a type

Sources/Sentry/Public/SentryMechanismMeta.h renamed to Sources/Sentry/Public/SentryMechanismContext.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ NS_ASSUME_NONNULL_BEGIN
1717
* along with a platform-dependent interpretation of these codes.
1818
* @see https://develop.sentry.dev/sdk/event-payloads/exception/#meta-information.
1919
*/
20-
NS_SWIFT_NAME(MechanismMeta)
21-
@interface SentryMechanismMeta : NSObject <SentrySerializable>
20+
NS_SWIFT_NAME(MechanismContext)
21+
@interface SentryMechanismContext : NSObject <SentrySerializable>
2222

2323
- (instancetype)init;
2424

Sources/Sentry/Public/SentryWithoutUIKit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[];
2828
# import <SentryWithoutUIKit/SentryIntegrationProtocol.h>
2929
# import <SentryWithoutUIKit/SentryMeasurementUnit.h>
3030
# import <SentryWithoutUIKit/SentryMechanism.h>
31-
# import <SentryWithoutUIKit/SentryMechanismMeta.h>
31+
# import <SentryWithoutUIKit/SentryMechanismContext.h>
3232
# import <SentryWithoutUIKit/SentryMessage.h>
3333
# import <SentryWithoutUIKit/SentryNSError.h>
3434
# import <SentryWithoutUIKit/SentryOptions.h>

Sources/Sentry/SentryClient.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#import "SentryInternalDefines.h"
1717
#import "SentryLogC.h"
1818
#import "SentryMechanism.h"
19-
#import "SentryMechanismMeta.h"
19+
#import "SentryMechanismContext.h"
2020
#import "SentryMessage.h"
2121
#import "SentryMeta.h"
2222
#import "SentryMsgPackSerializer.h"
@@ -288,7 +288,7 @@ - (SentryException *)exceptionForError:(NSError *)error
288288

289289
// Sentry uses the error domain and code on the mechanism for gouping
290290
SentryMechanism *mechanism = [[SentryMechanism alloc] initWithType:@"NSError"];
291-
SentryMechanismMeta *mechanismMeta = [[SentryMechanismMeta alloc] init];
291+
SentryMechanismContext *mechanismMeta = [[SentryMechanismContext alloc] init];
292292
mechanismMeta.error = [[SentryNSError alloc] initWithDomain:error.domain code:error.code];
293293
mechanism.meta = mechanismMeta;
294294
// The description of the error can be especially useful for error from swift that

Sources/Sentry/SentryCrashReportConverter.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#import "SentryInternalDefines.h"
1212
#import "SentryLogC.h"
1313
#import "SentryMechanism.h"
14-
#import "SentryMechanismMeta.h"
14+
#import "SentryMechanismContext.h"
1515
#import "SentryStacktrace.h"
1616
#import "SentrySwift.h"
1717
#import "SentryThread.h"
@@ -557,7 +557,7 @@ - (SentryMechanism *_Nullable)extractMechanismOfType:(nonnull NSString *)type
557557
if (nil != self.exceptionContext[@"mach"]) {
558558
mechanism.handled = @(NO);
559559

560-
SentryMechanismMeta *meta = [[SentryMechanismMeta alloc] init];
560+
SentryMechanismContext *meta = [[SentryMechanismContext alloc] init];
561561

562562
NSMutableDictionary *machException = [NSMutableDictionary new];
563563
[machException setValue:self.exceptionContext[@"mach"][@"exception_name"] forKey:@"name"];

Sources/Sentry/SentryMechanism.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#import "SentryMechanism.h"
22
#import "NSMutableDictionary+Sentry.h"
3-
#import "SentryMechanismMeta.h"
3+
#import "SentryMechanismContext.h"
44
#import "SentryNSDictionarySanitize.h"
55
#import "SentryNSError.h"
66

Sources/Sentry/SentryMechanismMeta.m renamed to Sources/Sentry/SentryMechanismContext.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#import "SentryMechanismMeta.h"
1+
#import "SentryMechanismContext.h"
22
#import "SentryNSDictionarySanitize.h"
33
#import "SentryNSError.h"
44

55
NS_ASSUME_NONNULL_BEGIN
66

7-
@implementation SentryMechanismMeta
7+
@implementation SentryMechanismContext
88

99
- (instancetype)init
1010
{

0 commit comments

Comments
 (0)