Conversation
Reproduces the issue where CameraX PreviewView content may not be properly masked in Sentry Session Replay. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
|
||
| SentryAndroid.init(this) { options -> | ||
| // Set your DSN or use environment variable SENTRY_DSN | ||
| options.dsn = System.getenv("SENTRY_DSN") ?: "" |
There was a problem hiding this comment.
Environment variable retrieval won't work on Android
High Severity
System.getenv("SENTRY_DSN") will always return null on Android devices because apps run in isolated processes that don't inherit the build machine's shell environment. The README instructs users to export SENTRY_DSN=... before building, but this env var won't be accessible at runtime. The DSN will always be empty, preventing Sentry from capturing any replays and rendering this reproduction project non-functional.
| binding = ActivityMainBinding.inflate(layoutInflater) | ||
| setContentView(binding.root) | ||
|
|
||
| cameraExecutor = Executors.newSingleThreadExecutor() |
There was a problem hiding this comment.
Unused cameraExecutor creates unnecessary thread pool
Low Severity
The cameraExecutor is declared and initialized as a single-thread executor but is never actually used. The camera provider listener at line 111 uses ContextCompat.getMainExecutor(this) instead. This results in an unnecessary thread pool allocation that only gets shut down in onDestroy().
Additional Locations (1)
| val cameraProviderFuture = ProcessCameraProvider.getInstance(this) | ||
|
|
||
| cameraProviderFuture.addListener({ | ||
| val cameraProvider = cameraProviderFuture.get() |
There was a problem hiding this comment.
Unhandled exception from camera provider initialization
Low Severity
The cameraProviderFuture.get() call is outside the try-catch block that handles camera errors. If ProcessCameraProvider initialization fails (e.g., on emulators, devices with camera issues, or unusual configurations), this throws an uncaught ExecutionException that crashes the app without being logged to Sentry. The try-catch only covers unbindAll() and bindToLifecycle(), missing this earlier failure point.


Summary
Reproduces the issue where CameraX
PreviewViewcontent may not be properly masked in Sentry Session Replay.PreviewViewto display camera feedTest Instructions
export SENTRY_DSN="your-dsn-here"./gradlew installDebugExpected vs Actual
🤖 Generated with Claude Code