sentry-cordova icon indicating copy to clipboard operation
sentry-cordova copied to clipboard

Without `dist` explicitly set it shows on Android but not on iOS

Open bruno-garcia opened this issue 3 years ago • 12 comments

e.g:

<script> (function (w) { var i = (w.SENTRY_RELEASE = w.SENTRY_RELEASE || {}); i.id = ‘675adc71dca71be2c5e5’; })(this); </script>

bruno-garcia avatar Aug 29 '22 18:08 bruno-garcia

https://github.com/getsentry/sentry-react-native/blob/c7547e66a21fb9db76a2899f82b7ae2aa07544f4/src/js/integrations/release.ts#L50-L58 That's how it works on RN.

marandaneto avatar Aug 30 '22 07:08 marandaneto

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?

souredoutlook avatar Aug 31 '22 02:08 souredoutlook

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?

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 avatar Aug 31 '22 12:08 lucas-zimerman

@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.

souredoutlook avatar Aug 31 '22 12:08 souredoutlook

@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 😅

lucas-zimerman avatar Aug 31 '22 13:08 lucas-zimerman

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 avatar Sep 09 '22 18:09 souredoutlook

@souredoutlook Ok so, I was able to reproduce it and we could do two things:

  1. remove the default Dist from the events on Android.
  2. 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 ?

lucas-zimerman avatar Sep 28 '22 13:09 lucas-zimerman

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 🥀

github-actions[bot] avatar Oct 20 '22 00:10 github-actions[bot]

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 🥀

github-actions[bot] avatar Nov 18 '22 00:11 github-actions[bot]

I'll defer to @kahest as I dunno how to proceed

bruno-garcia avatar Nov 18 '22 03:11 bruno-garcia

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?

kahest avatar Nov 18 '22 10:11 kahest

Implementing this solution https://github.com/getsentry/sentry-capacitor/pull/480 will fix this issue

lucas-zimerman avatar Nov 24 '23 13:11 lucas-zimerman