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

Risk state (EXPOSUREAPP-5697) #2728

Merged
merged 108 commits into from
Apr 1, 2021
Merged

Conversation

chiljamgossow
Copy link
Contributor

@chiljamgossow chiljamgossow commented Apr 1, 2021

Most changes are renaming only in order to differentiate between the risk results.

There are now two sets of risk results, one for exposure windows (ew) and one for presence tracing (pt). They are all available in the RiskLevelStorage interface.

The risk calculation for ew remains untouched. It is still the basis for all analytics and survey logic.

The two sets are combined to CombinedEwPtRisk, to be used for the home tracing card and details.
Changes in this combined risk should trigger the risk level change notification (see RiskLevelChangeDetector).

The home card will always show the highest risk that was calculated, that means if there is one high risk check-in or encounter, it will turn red. Calculation failed will only show if both calculations failed.

How to test: check whether the old risk calculation with exposure windows still works as before

Once the warning downloads are available, the risk from check-ins should also show up.

Missing: all unit tests -> follow up PR

# Conflicts:
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/CheckIn.kt
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/download/CheckInsPackage.kt
# Conflicts:
#	Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/eventregistration/ui/EventRegistrationTestFragmentViewModel.kt
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/riskcalculation/PresenceTracingRiskCalculator.kt
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/riskcalculation/PresenceTracingRiskMapper.kt
#	Corona-Warn-App/src/test/java/de/rki/coronawarnapp/eventregistration/checkins/riskcalculation/PresenceTracingRiskCalculatorTest.kt
#	Corona-Warn-App/src/test/java/de/rki/coronawarnapp/eventregistration/checkins/riskcalculation/PresenceTracingRiskMapperTest.kt
# Conflicts:
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/CheckIn.kt
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInRepository.kt
#	Corona-Warn-App/src/test/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInRepositoryTest.kt
# Conflicts:
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/riskcalculation/Matching.kt
@d4rken d4rken added the prio PRs to review first. label Apr 1, 2021
@chiljamgossow chiljamgossow marked this pull request as ready for review April 1, 2021 11:36
@BMItr BMItr self-assigned this Apr 1, 2021
BMItr
BMItr previously approved these changes Apr 1, 2021
Copy link
Contributor

@BMItr BMItr left a comment

Choose a reason for hiding this comment

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

lgtm 👌
one optional comment

@jurajkusnier jurajkusnier self-assigned this Apr 1, 2021
BMItr
BMItr previously approved these changes Apr 1, 2021
val endTime = timeStamper.nowUTC.minus(Days.days(15).toStandardDuration())
traceTimeIntervalMatchDao.deleteOlderThan(endTime.millis)
internal suspend fun markPackageProcessed(warningPackageId: String) {
// TODO
Copy link
Contributor

Choose a reason for hiding this comment

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

when/where this will be implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When @d4rken has finished #2707 due to a missing db field

# Conflicts:
#	Corona-Warn-App/schemas/de.rki.coronawarnapp.eventregistration.storage.TraceLocationDatabase/1.json
@sonarcloud
Copy link

sonarcloud bot commented Apr 1, 2021

Kudos, SonarCloud Quality Gate passed!

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

44.1% 44.1% Coverage
0.0% 0.0% Duplication

@harambasicluka harambasicluka merged commit 3e5563c into release/2.0.x Apr 1, 2021
@harambasicluka harambasicluka deleted the feature/5697-risk-state branch April 1, 2021 14:09
@vaubaehn
Copy link
Contributor

vaubaehn commented May 4, 2021

I was thinking about error notifications, if either EW calculations or PT calculations for any reason (and there are some...) permanently fail in the future...
Band-aid to get aware of problems and to start debugging: corona-warn-app/cwa-wishlist#497
Possible Long-term solution: corona-warn-app/cwa-wishlist#497 (comment) // #2995 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
maintainers Tag pull requests created by maintainers prio PRs to review first.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants