Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Missing presence tracing (EXPOSUREAPP-14413) #5773

Merged
merged 2 commits into from
Dec 21, 2022

Conversation

schauersbergern
Copy link
Contributor

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

@schauersbergern schauersbergern added bug Something isn't working maintainers Tag pull requests created by maintainers labels Dec 21, 2022
@schauersbergern schauersbergern added this to the 3.0.x milestone Dec 21, 2022
@schauersbergern schauersbergern requested a review from a team December 21, 2022 07:49
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@mtwalli mtwalli self-assigned this Dec 21, 2022
@mtwalli mtwalli merged commit 53e276e into release/3.0.x Dec 21, 2022
@mtwalli mtwalli deleted the fix/14413_checkin_racecondition branch December 21, 2022 09:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants