feat(core): Add disableAutoUpload option to Expo plugin
#6195
1 issue
find-bugs: Found 1 issue (1 medium)
Medium
`disableAutoUpload: false` does not remove the Gradle override added by a prior `true` run - `packages/core/plugin/src/withSentry.ts:21`
In withSentryAndroid.ts, modifyAppBuildGradle only adds project.ext.shouldSentryAutoUploadGeneral = { -> return false } and never removes it. If a developer sets disableAutoUpload: true, runs expo prebuild, then removes the flag (or sets it to false) and reruns prebuild, the override stays in android/app/build.gradle and source map / debug symbol uploads remain silently disabled. The same shape of bug also exists on iOS (SENTRY_DISABLE_AUTO_UPLOAD=true injected into existing build phases is never removed when the flag flips back to false), so the fix should be symmetric.
Also found at:
packages/core/plugin/src/withSentryAndroid.ts:43-52packages/core/test/expo-plugin/modifyAppBuildGradle.test.ts:66-69packages/core/plugin/src/withSentry.ts:71packages/core/plugin/src/withSentry.ts:88packages/core/test/expo-plugin/modifyXcodeProject.test.ts:128-133
โฑ 10m 6s ยท 674.0k in / 82.1k out ยท $2.81
Annotations
Check warning on line 21 in packages/core/plugin/src/withSentry.ts
sentry-warden / warden: find-bugs
`disableAutoUpload: false` does not remove the Gradle override added by a prior `true` run
In `withSentryAndroid.ts`, `modifyAppBuildGradle` only adds `project.ext.shouldSentryAutoUploadGeneral = { -> return false }` and never removes it. If a developer sets `disableAutoUpload: true`, runs `expo prebuild`, then removes the flag (or sets it to `false`) and reruns prebuild, the override stays in `android/app/build.gradle` and source map / debug symbol uploads remain silently disabled. The same shape of bug also exists on iOS (`SENTRY_DISABLE_AUTO_UPLOAD=true` injected into existing build phases is never removed when the flag flips back to false), so the fix should be symmetric.
Check warning on line 52 in packages/core/plugin/src/withSentryAndroid.ts
sentry-warden / warden: find-bugs
[ACN-HC6] `disableAutoUpload: false` does not remove the Gradle override added by a prior `true` run (additional location)
In `withSentryAndroid.ts`, `modifyAppBuildGradle` only adds `project.ext.shouldSentryAutoUploadGeneral = { -> return false }` and never removes it. If a developer sets `disableAutoUpload: true`, runs `expo prebuild`, then removes the flag (or sets it to `false`) and reruns prebuild, the override stays in `android/app/build.gradle` and source map / debug symbol uploads remain silently disabled. The same shape of bug also exists on iOS (`SENTRY_DISABLE_AUTO_UPLOAD=true` injected into existing build phases is never removed when the flag flips back to false), so the fix should be symmetric.
Check warning on line 69 in packages/core/test/expo-plugin/modifyAppBuildGradle.test.ts
sentry-warden / warden: find-bugs
[ACN-HC6] `disableAutoUpload: false` does not remove the Gradle override added by a prior `true` run (additional location)
In `withSentryAndroid.ts`, `modifyAppBuildGradle` only adds `project.ext.shouldSentryAutoUploadGeneral = { -> return false }` and never removes it. If a developer sets `disableAutoUpload: true`, runs `expo prebuild`, then removes the flag (or sets it to `false`) and reruns prebuild, the override stays in `android/app/build.gradle` and source map / debug symbol uploads remain silently disabled. The same shape of bug also exists on iOS (`SENTRY_DISABLE_AUTO_UPLOAD=true` injected into existing build phases is never removed when the flag flips back to false), so the fix should be symmetric.
Check warning on line 71 in packages/core/plugin/src/withSentry.ts
sentry-warden / warden: find-bugs
[ACN-HC6] `disableAutoUpload: false` does not remove the Gradle override added by a prior `true` run (additional location)
In `withSentryAndroid.ts`, `modifyAppBuildGradle` only adds `project.ext.shouldSentryAutoUploadGeneral = { -> return false }` and never removes it. If a developer sets `disableAutoUpload: true`, runs `expo prebuild`, then removes the flag (or sets it to `false`) and reruns prebuild, the override stays in `android/app/build.gradle` and source map / debug symbol uploads remain silently disabled. The same shape of bug also exists on iOS (`SENTRY_DISABLE_AUTO_UPLOAD=true` injected into existing build phases is never removed when the flag flips back to false), so the fix should be symmetric.
Check warning on line 88 in packages/core/plugin/src/withSentry.ts
sentry-warden / warden: find-bugs
[ACN-HC6] `disableAutoUpload: false` does not remove the Gradle override added by a prior `true` run (additional location)
In `withSentryAndroid.ts`, `modifyAppBuildGradle` only adds `project.ext.shouldSentryAutoUploadGeneral = { -> return false }` and never removes it. If a developer sets `disableAutoUpload: true`, runs `expo prebuild`, then removes the flag (or sets it to `false`) and reruns prebuild, the override stays in `android/app/build.gradle` and source map / debug symbol uploads remain silently disabled. The same shape of bug also exists on iOS (`SENTRY_DISABLE_AUTO_UPLOAD=true` injected into existing build phases is never removed when the flag flips back to false), so the fix should be symmetric.
Check warning on line 133 in packages/core/test/expo-plugin/modifyXcodeProject.test.ts
sentry-warden / warden: find-bugs
[ACN-HC6] `disableAutoUpload: false` does not remove the Gradle override added by a prior `true` run (additional location)
In `withSentryAndroid.ts`, `modifyAppBuildGradle` only adds `project.ext.shouldSentryAutoUploadGeneral = { -> return false }` and never removes it. If a developer sets `disableAutoUpload: true`, runs `expo prebuild`, then removes the flag (or sets it to `false`) and reruns prebuild, the override stays in `android/app/build.gradle` and source map / debug symbol uploads remain silently disabled. The same shape of bug also exists on iOS (`SENTRY_DISABLE_AUTO_UPLOAD=true` injected into existing build phases is never removed when the flag flips back to false), so the fix should be symmetric.