Open lognaturel opened 3 years ago
Ah the isBackgroundRecording
call is probably not what we want here. We can probably fix but just doing audioRecorder.getCurrentSession().getValue().getId() instanceof Set
instead.
Oh and I think this probably doesn't fail in tests as it isn't using a service behind the scenes. It's probably easy enough to drive the fix out with a test at the BackgroundAudioViewModel
level though.
Launch a form with multiple
odk:recordaudio
actions such as one-question-background-audio-multiple.xml.zip. For that form, bothrecording1
andrecording2
should be populated with the same audio filename. However, onlyrecording1
is populated.I believe the issue is a race condition. I think the first call on
startBackgroundRecording
has not yet completed when the second one is fired and so the second check onisBackgroundRecording
is false.I don't think this is a big deal. It's good that we have a strategy for supporting the multiple actions but not critical that it be supported immediately. We can document that if there's more than one action, all but the first will be ignored. This is especially the case since it looks like Central does not support receiving the multiple files: https://github.com/getodk/central-backend/issues/330