ground-android icon indicating copy to clipboard operation
ground-android copied to clipboard

[Data collection] First photo taken with camera doesn't appear

Open gino-m opened this issue 4 years ago • 5 comments
trafficstars

The first time a photo is taken, the user is prompted to go through the permissions flows. The camera appears, and the user can take photos, but upon taking a photo the user is not returned to the app. Presenting the back button returns the user to the add/edit observation form, but the photo(s) taken do not appear in the form.

To Reproduce

Steps to reproduce the behavior:

  1. Add a feature in a layer that uses photos, add an observation.
  2. Click "Add photo"
  3. Click through the permissions flow.
  4. Snap a photo
  5. Click "back" to return to form.

This only occurs the first time a photo is taken; subsequent attempts work.

Observed on various emulator versions.

Expected behavior The checkmark appears in the camera and the photo appears in the observation form.

Actual behavior The checkmark does not appear in the camera, and the photo doesn't appear when returning to the app.

@shobhitagarwal1612 Think you could take a look? 🙏

gino-m avatar Jun 08 '21 22:06 gino-m

I can't reproduce it locally. Tried fresh installing the app, with and without airplane mode. Is it possible for you to provide a stack trace?

shobhitagarwal1612 avatar Jun 13 '21 06:06 shobhitagarwal1612

@shobhitagarwal1612 I didn't see anything relevant it the logs; no stack trace in Error log, no mentions of "camera" or "photo" at Verbose

Tested with build at commit 675415446a7041ee6b45a32db87465b85a5c2a1d on AS emulator with Pixel API 28:

  1. Create new or wipe data on existing AVD (Pixel API 28).
  2. Run app, sign in, select project with forms with photos.
  3. Add an observation to a feature in a layer with photos.
  4. Add a photo, go through permissions flow.

See repro here:

ezgif-5-8b2a74ff059e

gino-m avatar Jun 14 '21 22:06 gino-m

Thanks for the recording. In my flow, the location permission for camera app was never asked. Maybe that was the missing piece I was looking for. Thanks!

shobhitagarwal1612 avatar Jun 15 '21 04:06 shobhitagarwal1612

I can reproduce the error only if the camera app is opened for the first time (When "Remember photo locations?" dialog appears). It appears that the camera app forgets the capture intent because of the above dialog. Not sure what can be done to prevent this.

shobhitagarwal1612 avatar Jul 03 '21 11:07 shobhitagarwal1612

Confirmed there is an intent returned with the original request code, but the result code is 0 and the intent is null:

For posterity, the interstitial dialog contents are: "Remember photo locations?" and "Tag your photos and videos with the locations where they're taken" Screenshot_1625594622

I see some physical devices online that use this dialog, so if we can't fix this we should at least show an error dialog when an error result code is returned.

gino-m avatar Jul 06 '21 18:07 gino-m

@JSunde is this fixed given our recent changes? @shobhitagarwal1612 for additional context.

scolsen avatar Feb 27 '23 18:02 scolsen

Yes I believe this is fixed with the recent permissions and photo task changes

JSunde avatar Feb 27 '23 19:02 JSunde