Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
- Bump JavaScript SDK from v10.26.0 to v10.29.0 ([#5406](https://github.com/getsentry/sentry-react-native/pull/5406), [#5429](https://github.com/getsentry/sentry-react-native/pull/5429), [#5442](https://github.com/getsentry/sentry-react-native/pull/5442))
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#10290)
- [diff](https://github.com/getsentry/sentry-javascript/compare/10.26.0...10.29.0)
- Bump Cocoa SDK from v8.57.3 to v9.0.0 ([#5417](https://github.com/getsentry/sentry-react-native/pull/5417))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#900)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.57.3...9.0.0)

## 7.7.0

Expand Down
2 changes: 1 addition & 1 deletion packages/core/RNSentry.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Pod::Spec.new do |s|

s.compiler_flags = other_cflags

This comment was marked as outdated.

s.dependency 'Sentry/HybridSDK', '8.57.3'
s.dependency 'Sentry/HybridSDK', '9.0.0'

This comment was marked as outdated.


if defined? install_modules_dependencies
# Default React Native dependencies for 0.71 and above (new and legacy architecture)
Comment on lines 46 to 52

This comment was marked as outdated.

Comment on lines 46 to 52
Copy link

Choose a reason for hiding this comment

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

Bug: The setExtra method uses [scope setExtraValue:extra forKey:key], an API removed in Cocoa SDK v9.0.0. This will cause a runtime crash when called from JavaScript.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The pull request upgrades the Cocoa SDK to v9.0.0, which removes the deprecated setExtraValue:forKey: method from SentryScope. However, the native setExtra method in RNSentry.mm still uses this removed API. As a result, any call to the setExtra function from the React Native JavaScript bridge will trigger an "unrecognized selector sent to instance" error, leading to a native crash of the application.

💡 Suggested Fix

In packages/core/ios/RNSentry.mm, update the setExtra method to use the new setContextValue:forKey: API instead of the removed setExtraValue:forKey:. The implementation can follow the pattern used by the setContext method in the same file. Specifically, replace [scope setExtraValue:extra forKey:key] with [scope setContextValue:extra forKey:key].

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: packages/core/RNSentry.podspec#L46-L52

Potential issue: The pull request upgrades the Cocoa SDK to v9.0.0, which removes the
deprecated `setExtraValue:forKey:` method from `SentryScope`. However, the native
`setExtra` method in `RNSentry.mm` still uses this removed API. As a result, any call to
the `setExtra` function from the React Native JavaScript bridge will trigger an
"unrecognized selector sent to instance" error, leading to a native crash of the
application.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 6842183

Expand Down
Loading