sentry-cordova
sentry-cordova copied to clipboard
Without `dist` explicitly set it shows on Android but not on iOS
e.g:
<script> (function (w) { var i = (w.SENTRY_RELEASE = w.SENTRY_RELEASE || {}); i.id = ‘675adc71dca71be2c5e5’; })(this); </script>
https://github.com/getsentry/sentry-react-native/blob/c7547e66a21fb9db76a2899f82b7ae2aa07544f4/src/js/integrations/release.ts#L50-L58 That's how it works on RN.
Hey all, slight confusion here on my part.
Sorry @bruno-garcia for the misleading Slack message.
The script tag seems to be working as expected, but one thing I noticed was that the dist value on Android seems to get added to the events, even if it's not added to the Sentry.init() options. It is present in the config.xml, like so:
<widget android-versionCode="27696605" id="some_id" ios-CFBundleVersion="27696605" osx-CFBundleVersion="27696605" version="1.0.34" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
This is only happening on Android, not iOs. Any advice for how to work around this?
Hey all, slight confusion here on my part.
Sorry @bruno-garcia for the misleading Slack message.
The script tag seems to be working as expected, but one thing I noticed was that the
distvalue on Android seems to get added to the events, even if it's not added to the Sentry.init() options. It is present in the config.xml, like so:
<widget android-versionCode="27696605" id="some_id" ios-CFBundleVersion="27696605" osx-CFBundleVersion="27696605" version="1.0.34" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">This is only happening on Android, not iOs. Any advice for how to work around this?
Just to be clear, the issue here is the dist parameter being set on Android, despite it not being set by the user?
@lucas-zimerman yes that's the concern. The workaround is to manually remove it from events but this customer would rather it not get set at all if they don't declare it. To my knowledge, this is how sentry-react-native handles this but I might be mistaken.
@lucas-zimerman yes that's the concern. The workaround is to manually remove it from events but this customer would rather it not get set at all if they don't declare it. To my knowledge, this is how sentry-react-native handles this but I might be mistaken.
By the way, do you have a sample that you are testing Cordova? I was going to check what's going on but I found another issue that is not allowing me to validate it on my sample app 😅
hi @lucas-zimerman
I don't have a sample app to test this, unfortunately.
I'm going to move forward with recommending they remove the field in beforeSend as a temporary workaround.
@souredoutlook Ok so, I was able to reproduce it and we could do two things:
- remove the default Dist from the events on Android.
- when uploading the sourcemaps for Android, we could set the default dist for Android when uploading the sourcemaps if it weren't set by the user.
I believe the second option is more adequate since it'll not generate any break changes if users are using the default dist. Any thoughts @bruno-garcia ?
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
I'll defer to @kahest as I dunno how to proceed
Thanks for investigating this @lucas-zimerman! Generally I'd say go with option 2 to prevent breaking things, but that would mean changing this in sentry-cli, right?
Implementing this solution https://github.com/getsentry/sentry-capacitor/pull/480 will fix this issue