This repository was archived by the owner on Jun 20, 2023. It is now read-only.
Missing presence tracing (EXPOSUREAPP-14413) #5773
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ticket
Problem:
Current shareSelectedCheckIns() fun in CheckInsConsentViewModel produced following log:
2022-12-13T14:12:17.022Z D/CheckInsConsentViewModel: SelectedCheckIns=[2]
2022-12-13T14:12:19.900Z D/CheckInsConsentViewModel$shareSelectedCheckIns: Navigate to shareSelectedCheckIns
2022-12-13T14:12:19.900Z D/CheckInRepository: updateSubmissionConsents(checkInIds=[2], consent=true)
2022-12-13T14:12:19.901Z D/CheckInsConsentViewModel$resetPreviousSubmissionConsents: Trying to reset submission consents
2022-12-13T14:12:19.902Z D/CheckInsConsentViewModel$shareSelectedCheckIns: Navigate to SubmissionTestResultConsentGivenFragment
2022-12-13T14:12:19.909Z D/CheckInRepository: updateSubmissionConsents(checkInIds=[2], consent=false)
It seems like first launched resetPreviousSubmissionConsents() in this case is processed later in the task queue than updateSubmissionConsents. This sets the consent to true and then to false, resulting to behaviour that the checkin is not sent on submission: (see empty checkins)
2022-12-13T14:12:31.548Z D/SubmissionTask: Submitting SubmissionData(registrationToken=########-####-####-####-########39db, authCode=########-####-####-####-########92ab, temporaryExposureKeys=[# de.rki.coronawarnapp.server.protocols.external.exposurenotification.TemporaryExposureKeyExportOuterClass$TemporaryExposureKey@69cf4e69], consentToFederation=true, visitedCountries=[DE, IE, LV, HR, SI], unencryptedCheckIns=[], encryptedCheckIns=[], submissionType=SUBMISSION_TYPE_PCR_TEST)
Solution:
Changing resetPreviousSubmissionConsents() to a suspending function should ensure that checkInRepository.updateSubmissionConsents is not called until resetPreviousSubmissionConsents finished