feat(core): Add disableAutoUpload option to Expo plugin
#6195
2 issues
code-review: Found 2 issues (1 medium, 1 low)
Medium
Toggling `disableAutoUpload` back to `false` leaves stale `shouldSentryAutoUploadGeneral` override in build.gradle - `packages/core/plugin/src/withSentryAndroid.ts:45-51`
When disableAutoUpload is changed from true back to false and prebuild is re-run, the existing shouldSentryAutoUploadGeneral = { -> return false } override is never removed, so auto-upload stays silently disabled. Consider adding a removal branch when disableAutoUpload is false but the override is already present.
Also found at:
packages/core/plugin/src/withSentryIOS.ts:72-75packages/core/test/expo-plugin/modifyAppBuildGradle.test.ts:60-63
Low
Misleading `warnOnce` emitted even after successfully injecting disable flag - `packages/core/test/expo-plugin/modifyXcodeProject.test.ts:118`
When sentry-xcode.sh is already present and disableAutoUpload: true is set (the re-prebuild path tested at line 118), modifyExistingXcodeBuildScript calls addDisableAutoUploadToExistingScript correctly but then unconditionally calls warnOnce('The latest sentry-xcode.sh script already exists…'), which may confuse users into thinking nothing happened; the test at line 118 doesn't assert whether warnOnce was or wasn't called.
⏱ 4m 13s · 303.4k in / 35.1k out · $1.41
Annotations
Check warning on line 51 in packages/core/plugin/src/withSentryAndroid.ts
sentry-warden / warden: code-review
Toggling `disableAutoUpload` back to `false` leaves stale `shouldSentryAutoUploadGeneral` override in build.gradle
When `disableAutoUpload` is changed from `true` back to `false` and prebuild is re-run, the existing `shouldSentryAutoUploadGeneral = { -> return false }` override is never removed, so auto-upload stays silently disabled. Consider adding a removal branch when `disableAutoUpload` is `false` but the override is already present.
Check warning on line 75 in packages/core/plugin/src/withSentryIOS.ts
sentry-warden / warden: code-review
[S6U-TU6] Toggling `disableAutoUpload` back to `false` leaves stale `shouldSentryAutoUploadGeneral` override in build.gradle (additional location)
When `disableAutoUpload` is changed from `true` back to `false` and prebuild is re-run, the existing `shouldSentryAutoUploadGeneral = { -> return false }` override is never removed, so auto-upload stays silently disabled. Consider adding a removal branch when `disableAutoUpload` is `false` but the override is already present.
Check warning on line 63 in packages/core/test/expo-plugin/modifyAppBuildGradle.test.ts
sentry-warden / warden: code-review
[S6U-TU6] Toggling `disableAutoUpload` back to `false` leaves stale `shouldSentryAutoUploadGeneral` override in build.gradle (additional location)
When `disableAutoUpload` is changed from `true` back to `false` and prebuild is re-run, the existing `shouldSentryAutoUploadGeneral = { -> return false }` override is never removed, so auto-upload stays silently disabled. Consider adding a removal branch when `disableAutoUpload` is `false` but the override is already present.