Skip to content

Conversation

@philprime
Copy link
Member

@philprime philprime commented Oct 30, 2025

Description

This PR renames SentryMechanismMeta to SentryMechanismContext to resolve naming conflicts with Kotlin Multiplatform's metaprogramming features.

Closes #2888

Changes

Renamed Classes

  • SentryMechanismMetaSentryMechanismContext
  • Swift name: MechanismMetaMechanismContext

Files Changed

  • Created:

    • Sources/Sentry/Public/SentryMechanismContext.h
    • Sources/Sentry/SentryMechanismContext.m
    • Sources/Swift/Protocol/Codable/SentryMechanismContextCodable.swift
    • Tests/SentryTests/Protocol/SentryMechanismContextTests.swift
  • Deleted:

    • Sources/Sentry/Public/SentryMechanismMeta.h
    • Sources/Sentry/SentryMechanismMeta.m
    • Sources/Swift/Protocol/Codable/SentryMechanismMetaCodable.swift
    • Tests/SentryTests/Protocol/SentryMechanismMetaTests.swift
  • Updated:

    • All import statements across the codebase
    • Public headers (Sentry.h, SentryWithoutUIKit.h, SentryMechanism.h)
    • Xcode project file
    • SDK API file
    • Test files and utilities

Testing

  • ✅ iOS build successful
  • ✅ macOS build successful
  • ✅ All SentryMechanismContextTests pass on iOS
  • ✅ All SentryMechanismContextTests pass on macOS

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
@philprime philprime self-assigned this Oct 30, 2025
@codecov
Copy link

codecov bot commented Oct 30, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
3918 1 3917 55
View the top 1 failed test(s) by shortest run time
iOS_SwiftUI_UITests.FeedbackUITests::testWidgetDisplayInSwiftUIApp
Stack Traces | 0s run time
.../iOS-SwiftUI/iOS-SwiftUI-UITests/FeedbackUITests.swift:14 - Failed to get matching snapshots: Timed out while evaluating UI query.

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@philipphofmann
Copy link
Member

FYI @philprime, I pinged Gino if this is still required #2888 (comment)

@philprime philprime changed the title ref: Rename SentryMechanismMeta to SentryMechanismContext ref: Rename SentryMechanismMeta to SentryMechanismMetaInformation Oct 30, 2025
@philprime philprime marked this pull request as ready for review October 30, 2025 13:14
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, when CI is green and @buenaflor confirms this is still required #2888 (comment).

Thanks @philprime 🚀

@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1213.18 ms 1256.40 ms 43.22 ms
Size 23.75 KiB 1.01 MiB 1016.02 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7bb24a2 1229.16 ms 1256.66 ms 27.50 ms
1f48bb7 1223.83 ms 1241.85 ms 18.02 ms
1b008ee 1209.57 ms 1258.67 ms 49.10 ms
c2982e7 1223.92 ms 1242.86 ms 18.94 ms
a6f5396 1211.81 ms 1245.63 ms 33.82 ms
94a6b1a 1213.39 ms 1231.55 ms 18.17 ms
736bcfb 1229.86 ms 1249.59 ms 19.73 ms
8d944ac 1236.92 ms 1254.91 ms 18.00 ms
2a07609 1207.79 ms 1233.77 ms 25.98 ms
fc0757d 1231.83 ms 1248.98 ms 17.15 ms

App size

Revision Plain With Sentry Diff
7bb24a2 23.75 KiB 973.68 KiB 949.93 KiB
1f48bb7 23.75 KiB 971.98 KiB 948.24 KiB
1b008ee 23.75 KiB 929.71 KiB 905.96 KiB
c2982e7 23.75 KiB 911.62 KiB 887.87 KiB
a6f5396 23.75 KiB 989.12 KiB 965.38 KiB
94a6b1a 23.75 KiB 902.48 KiB 878.74 KiB
736bcfb 23.74 KiB 891.02 KiB 867.28 KiB
8d944ac 23.75 KiB 919.69 KiB 895.94 KiB
2a07609 23.75 KiB 912.78 KiB 889.03 KiB
fc0757d 23.75 KiB 850.73 KiB 826.98 KiB

Previous results on branch: philprime/refactor-mechanism-meta

Startup times

Revision Plain With Sentry Diff
9240af5 1196.53 ms 1226.39 ms 29.85 ms

App size

Revision Plain With Sentry Diff
9240af5 23.75 KiB 1.01 MiB 1016.19 KiB

@buenaflor
Copy link
Contributor

buenaflor commented Oct 31, 2025

@philipphofmann I think we general have issues if Meta is in the name of the class but don't let this block it you, it's not critical at all (https://youtrack.jetbrains.com/issue/KT-41709)

Change looks fine for me

@philipphofmann
Copy link
Member

https://youtrack.jetbrains.com/issue/KT-41709

@buenaflor the class name would still contain Meta and we're only renaming it because of KMP. So if it doesn't improve the situation we don't do the renaming. If you're saying it's not important, we don't have to do the refactoring at all.

@buenaflor
Copy link
Contributor

buenaflor commented Oct 31, 2025

In that case I agree this refactoring can be avoided unless you think something like SentryMechanismContext is alright then I'd opt for that but if you feel the change to SentryMechanismContext is too much work or has friction with other stuff we can just drop this

@philprime
Copy link
Member Author

I have already refactored SentryMechanismContext to SentryMechanismMetaInformation, so if we can not use Meta in the type name, let's go back to SentryMechanismContext or similar.

@philipphofmann I do not have a strong opinion on the naming, so even though the field is called meta I would go for SentryMechanismContext or similar. We could also consider renaming meta to context if that helps.

@philipphofmann
Copy link
Member

@philipphofmann I do not have a strong opinion on the naming, so even though the field is called meta I would go for SentryMechanismContext or similar. We could also consider renaming meta to context if that helps.

OK, then let's do SentryMechanismContext and add a comment on why we have to use that name. Not many people interact with that API, so it's not that important.

@philprime philprime enabled auto-merge (squash) November 3, 2025 12:39
@philprime philprime merged commit 5b5efea into main Nov 3, 2025
177 of 182 checks passed
@philprime philprime deleted the philprime/refactor-mechanism-meta branch November 3, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename SentryMechanismMeta to something else different than Meta

4 participants