Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Improve detect exposure flow #555

Merged
merged 1 commit into from
Jul 8, 2020
Merged

Conversation

henrytao-me
Copy link
Contributor

Using timeout can introduce race condition. This PR change the implementation on Android by:

  • Create a Promise wrapper to feed all 14 keys to the framework.
  • If one of the request is returned with matched key count, the Promise will be resolved.
  • We still keep the logic of Not persisting lastCheckPeriod for Android only. So that we won't miss any cases.

Follow up of #453

@henrytao-me henrytao-me requested a review from a team as a code owner July 8, 2020 22:34
@@ -105,23 +102,15 @@ class ExposureNotificationModule(context: ReactApplicationContext) : ReactContex

exposureNotificationClient.provideDiagnosisKeys(files, exposureConfiguration, token).await()

// Clean up files after feeding to the framework
files.forEach { it.cleanup() }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can clean up the file as soon as we feed them into the framework.

@henrytao-me henrytao-me merged commit 63e71a7 into master Jul 8, 2020
@henrytao-me henrytao-me deleted the hotfix/detect-exposure-android branch July 8, 2020 23:01
@henrytao-me
Copy link
Contributor Author

A last follow up PR is still needed when Google update framework to return NOT_FOUND. Then, we can add lastCheckPeriod back.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants