Skip to content

Conversation

@andreia-ferreira
Copy link
Collaborator

When trying to complete a photo task, if a user cancels taking the picture and tries to re-open the camera again nothing happens. This is because PhotoTaskViewModel.onCaptureResult was never setting hasLaunchedCamera as false if there was no picture captured, so the app didn't open a new camera intent since the logic determined it was still open. This is incorrect because when onCaptureResult is triggered, it means that the camera is not being used anymore.

This PR applies a small fix by setting hasLaunchedCamera as false regardless of the onCaptureResult value. This was also tested in an emulator to make sure it's properly fixed and without introducing new issues

@shobhitagarwal1612 PTAL?

@auto-assign auto-assign bot requested a review from sufyanAbbasi January 2, 2026 15:04
@codecov
Copy link

codecov bot commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.95%. Comparing base (68dce1c) to head (0fab969).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3427      +/-   ##
============================================
- Coverage     69.96%   69.95%   -0.01%     
  Complexity     1599     1599              
============================================
  Files           319      319              
  Lines          8587     8585       -2     
  Branches        945      945              
============================================
- Hits           6008     6006       -2     
  Misses         2005     2005              
  Partials        574      574              
Files with missing lines Coverage Δ
...i/datacollection/tasks/photo/PhotoTaskViewModel.kt 90.62% <100.00%> (-0.56%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant