Repository navigation
fix(ios): Stop importing SentryScope.h, removed in sentry-cocoa - #7079
sentry-junior[bot] wants to merge 1 commit into
Conversation
sentry-cocoa converted SentryScope to Swift (getsentry/sentry-cocoa#9552) and deleted Sources/Sentry/Public/SentryScope.h. RNSentryBreadcrumb.h, a public header in the RNSentry umbrella, still imported it, so the module no longer builds against sentry-cocoa main. Drop the unused import. RNSentry.mm then only sees a forward declaration of SentryScope and cannot message it, so route its scope mutations through SentrySDKWrapper, which imports the Sentry module. Co-Authored-By: Itay Brenner <itay.brenner@sentry.io>
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Fixes
- Stop importing SentryScope.h, removed in sentry-cocoa ([#7079](https://github.com/getsentry/sentry-react-native/pull/7079))If none of the above apply, you can opt out of this check by adding |
|
@antonis sharing this since you will probably need this change when bumping the version. |
|
@antonis in the end we are restoring this header in sentry-cocoa, so it won't be a breaking change. But removing the import is always a good idea |
|
Heads up: getsentry/sentry-cocoa#9721 brings |
📢 Type of change
📜 Description
#import <Sentry/SentryScope.h>fromRNSentryBreadcrumb.h. The header never used it.RNSentry.mmno longer gets theSentryScopeinterface transitively, and as Objective-C++ it can't@import Sentry, so it only sees@class SentryScope. Its scope mutations (setUser,addBreadcrumb,clearBreadcrumbs,setExtra,setContext/removeContext,setTag,setAttribute(s),removeAttribute) now go through newSentrySDKWrapperclass methods.SentrySDKWrapper.mimports the Sentry module and makes the sameconfigureScopecalls as before. Behavior doesn't change.fetchNativeLogAttributesandfetchNativeDeviceContextsstill callconfigureScopedirectly. They only pass the scope pointer toRNSentryInternalWrapper, so a forward declaration is enough.The selectors are the same in the ObjC
SentryScope.h(9.35.0, currently pinned) and in the SwiftScopeon sentry-cocoamain, so this works with both.💡 Motivation and Context
getsentry/sentry-cocoa#9552 converted
SentryScopeto Swift and deletedSources/Sentry/Public/SentryScope.h. Since then, the sentry-cocoa nightly "Hybrid SDKs / Test sentry-react-native" job can't build theRNSentrymodule:Failing run: https://github.com/getsentry/sentry-cocoa/actions/runs/44853776193
Without this change, the iOS build here breaks with the first sentry-cocoa release that includes #9552.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
There's no changelog entry because nothing changes for users. Open question: should it go under
### Internal?via itay.
--
View Session [Sentry]