-
Notifications
You must be signed in to change notification settings - Fork 496
Family Test Repository (EXPOSUREAPP-12330) #4986
Conversation
chiljamgossow
commented
Mar 23, 2022
•
edited
Loading
edited
- unit tests -> will be in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
...rn-App/src/main/java/de/rki/coronawarnapp/familytest/core/repository/FamilyTestRepository.kt
Outdated
Show resolved
Hide resolved
...rn-App/src/main/java/de/rki/coronawarnapp/familytest/core/repository/FamilyTestRepository.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Will approve once you decide what you wish to do with the naming.
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/familytest/core/model/BaseCoronaTest.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/familytest/core/model/BaseCoronaTest.kt
Outdated
Show resolved
Hide resolved
344cd18
to
774733a
Compare
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
|
||
@Singleton | ||
class FamilyTestRepository @Inject constructor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FamilyTestRepository is NOT thread-safe!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please elaborate more? you mean because the flow is not shared ?
@@ -276,3 +261,19 @@ private fun CoronaTestResult.toValidatedResult(): CoronaTestResult { | |||
RAT_INVALID | |||
} | |||
} | |||
|
|||
// After 60 days, the previously EXPIRED test is deleted from the server, and it may return pending again. | |||
fun check60DaysRAT(test: BaseCoronaTest, newResult: CoronaTestResult, now: Instant): CoronaTestResult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create only 1 method for both types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both methods are different from each other, even if the name looks the same
return if ((newResult == PCR_OR_RAT_PENDING || newResult == RAT_PENDING) && | ||
testAge > VerificationServer.TestAvailabilityDuration | ||
) { | ||
Timber.tag(RATestProcessor.TAG).d("$testAge is exceeding the test availability.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont use string templates for logging with timber. Make use of the lazy loading.
And VerificationServer.TestAvailabilityDuration should be logged to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
else -> false | ||
} | ||
|
||
val CoronaTestResult?.isPending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and rat pending?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The state says RAT_OR_PCR_PENDING, and this is not new, it was just moved from one place to another
see https://github.com/corona-warn-app/cwa-app-android/pull/4986/files#diff-74d8a3af0a20d2b26b9c921ae7b3bbf64dd14995365a3d31f7b3b483d7f970d9L76-L87