-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Bump sentry-cocoa to 6.1.4 + Native Wrapper and Cordova Transport #194
Conversation
Codecov Report
@@ Coverage Diff @@
## master #194 +/- ##
============================================
- Coverage 100.00% 59.81% -40.19%
============================================
Files 1 15 +14
Lines 9 321 +312
Branches 1 66 +65
============================================
+ Hits 9 192 +183
- Misses 0 128 +128
- Partials 0 1 +1
Continue to review full report at Codecov.
|
a85d495
to
a99422d
Compare
@@ -26,6 +26,7 @@ | |||
"dependencies": { | |||
"@sentry/browser": "6.1.0", | |||
"@sentry/core": "6.1.0", | |||
"@sentry/hub": "6.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a package just for the Hub now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, and we need to import it to use getCurrentHub
} | ||
return true; | ||
switch(action) { | ||
case "startWithOptions": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're keeping the iOS name as a standard?
Since sentry-cocoa is the outliner, wouldn't it be better to call it init
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm the name actually comes from the native bridge on RN (I realized that was actually the first thing I was tasked with at Sentry lol getsentry/sentry-react-native#860). So I figured we should keep the naming the same, save for when we do the unified native bridge module for hybrid SDKs.
src/ios/SentryCordova.m
Outdated
- (void)setContext:(CDVInvokedUrlCommand *)command { | ||
[self.commandDelegate runInBackground:^{ | ||
NSString *key = [command.arguments objectAtIndex:0]; | ||
NSDictionary *context = [command.arguments objectAtIndex:1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be a follow up PR after releasing a preview but shouldn't we use some defensive programming here and check in fact we have 2 items to read from arguments
and that they are indeed of the type we assume they are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff! Left a few notes
b68ab9f
to
700ee09
Compare
Notable Changes introduced in this PR
Resolves Bump Cocoa SDK to latest #192
Fixes Unable to build with XCode 12.3? #183
Resolves Refactor to use Native wrapper and Native transport like React Native #193
CordovaTransport
A special transport that checks if a native transport is available, the native transport is available it then uses it, otherwise it falls back to browser's Fetch/XHR transport. Currently only iOS has native transport, Android still uses the Fetch/XHR transport like on browser.
Extends the scope like on RN instead of adding a scope listener. This also adds support for
clearBreadcrumbs
andaddContext
.This removes the errors users have been seeing when running the SDK on browser.
Fixes Missing command Error on cordova-browser #184, Fixes Cordova browser platform not supported? #98
Testing
Added some tests for the wrapper adapted from React Native, however the former integration tests had to be removed as the SDK went through a major overhaul.
Manually tested on a sample app on browser, iOS, and Android.
Next Steps