Repository navigation
fix(ios): Stop importing SentryScope.h, removed in sentry-cocoa - #7079
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
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 <[email protected]>
Contributor
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. |
Contributor
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 |
Contributor
|
@antonis sharing this since you will probably need this change when bumping the version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 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]