Skip to content
Snippets Groups Projects
Unverified Commit c0938f58 authored by Matthias Urhahn's avatar Matthias Urhahn Committed by GitHub
Browse files

Don't overwrite the Google apitoken if we don't actually attempt submission. (#1660)

parent 3739d0e8
No related branches found
No related tags found
No related merge requests found
......@@ -61,10 +61,6 @@ class DownloadDiagnosisKeysTask @Inject constructor(
val currentDate = Date(timeStamper.nowUTC.millis)
Timber.tag(TAG).d("Using $currentDate as current date in task.")
/****************************************************
* RETRIEVE TOKEN
****************************************************/
val token = retrieveToken(rollbackItems)
throwIfCancelled()
// RETRIEVE RISK SCORE PARAMETERS
......@@ -105,7 +101,9 @@ class DownloadDiagnosisKeysTask @Inject constructor(
)
)
Timber.tag(TAG).d("Attempting submission to ENF")
val token = retrieveToken(rollbackItems)
Timber.tag(TAG).d("Attempting submission to ENF with token $token")
val isSubmissionSuccessful = enfClient.provideDiagnosisKeys(
keyFiles = availableKeyFiles,
configuration = exposureConfig.exposureDetectionConfiguration,
......@@ -180,6 +178,7 @@ class DownloadDiagnosisKeysTask @Inject constructor(
LocalData.googleApiToken(googleAPITokenForRollback)
}
return UUID.randomUUID().toString().also {
Timber.tag(TAG).d("Generating and storing new token: $it")
LocalData.googleApiToken(it)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment