-
Notifications
You must be signed in to change notification settings - Fork 496
Only use check-ins of last 15 days (EXPOSUREAPP-5910) #2752
Only use check-ins of last 15 days (EXPOSUREAPP-5910) #2752
Conversation
@LukasLechnerDev |
Hi @vaubaehn ! Great questions!
We decided that doing it on every app start is not enough (apps can be started and running for a long time) and doing it every time the app is brought to the foreground is too much :). Either way, we still could have outdated check-ins as some time will pass from the point in time when the user opens the app or brings it to foreground and then sees the check-ins or submits the check-ins. Therefore, I think it is best to just load the up-to date check-ins whenever we need them and also let a worker run daily to clean up all outdated checkins.
I don't think it takes that much time. One issue we could have if we clean the db when the user is currently in the check-ins screen could be that suddenly some outdated check-ins disappear.
I can't think of such a scenario ... |
...-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInRepository.kt
Outdated
Show resolved
Hide resolved
...a-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInRetention.kt
Outdated
Show resolved
Hide resolved
...a-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInRetention.kt
Outdated
Show resolved
Hide resolved
...App/src/main/java/de/rki/coronawarnapp/eventregistration/storage/retention/CheckInCleaner.kt
Outdated
Show resolved
Hide resolved
...c/main/java/de/rki/coronawarnapp/eventregistration/storage/retention/TraceLocationCleaner.kt
Outdated
Show resolved
Hide resolved
...main/java/de/rki/coronawarnapp/eventregistration/storage/retention/TraceLocationRetention.kt
Outdated
Show resolved
Hide resolved
...main/java/de/rki/coronawarnapp/eventregistration/storage/retention/TraceLocationRetention.kt
Outdated
Show resolved
Hide resolved
3f60ea8
to
7de7a6f
Compare
@LukasLechnerDev I'm very excitedly looking forward for release 2.0, pressing all thumbs and wishing it to become a great success! |
...main/java/de/rki/coronawarnapp/eventregistration/storage/retention/TraceLocationRetention.kt
Show resolved
Hide resolved
@vaubaehn Thanks for your feedback. You are right, it's definitely useful to document these functions better. I have added a commit (see above 👆) Thank you for your wishes! We are also very excited for |
…f-last-15-days' into feature/5910-Only-use-checkins-of-last-15-days
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.
Thank you! 😊
…ast-15-days # Conflicts: # Corona-Warn-App/src/main/java/de/rki/coronawarnapp/presencetracing/risk/CheckInWarningMatcher.kt # Corona-Warn-App/src/test/java/de/rki/coronawarnapp/presencetracing/risk/CheckInWarningMatcherTest.kt
…PresenceTracingWarningTask.kt and TraceWarningPackageSyncTool.kt
…ast-15-days # Conflicts: # Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/organizer/list/TraceLocationsViewModel.kt # Corona-Warn-App/src/test/java/de/rki/coronawarnapp/submission/task/SubmissionTaskTest.kt
Kudos, SonarCloud Quality Gate passed! |
* Only use check-ins of last 15 days * Refactor TraceLocation Retention * Fix SubmissionTaskTest.kt * Fix MainActivityViewModelTest.kt * Address PR feedback * Add CheckInRetentionTest.kt and TraceLocationRetentionTest.kt * Add some comments * Add more comments * Fix tests * Load checkInsWithinRetention instead of allCheckIns in ContactDiary, PresenceTracingWarningTask.kt and TraceWarningPackageSyncTool.kt Co-authored-by: harambasicluka <64483219+harambasicluka@users.noreply.github.com> Co-authored-by: Mohamed <mohamed.metwalli@sap.com>
…p#2752) * Only use check-ins of last 15 days * Refactor TraceLocation Retention * Fix SubmissionTaskTest.kt * Fix MainActivityViewModelTest.kt * Address PR feedback * Add CheckInRetentionTest.kt and TraceLocationRetentionTest.kt * Add some comments * Add more comments * Fix tests * Load checkInsWithinRetention instead of allCheckIns in ContactDiary, PresenceTracingWarningTask.kt and TraceWarningPackageSyncTool.kt Co-authored-by: harambasicluka <64483219+harambasicluka@users.noreply.github.com> Co-authored-by: Mohamed <mohamed.metwalli@sap.com>
Even though we have a worker that deletes all stale check-ins, it's still possible to have stale check-ins in the database because the worker runs only once a day.
This PR adds another function to
CheckInRepository
, calledcheckInWithinRetention
. This function only returns the check-ins which end date isn't older than 15 days.This new function is now used:
CheckInViewModel
: To not show outdated check-insMainActivityViewModel
: To not include outdated check-ins in the badge-count in Bottom NavSubmissionTask
: to not submit outdated check-insCheckInWarningMatcher
: To not match outdated check-insI also refactored the retention logic of
TraceLocations
by also adding atraceLocationsWithinRetention
property toDefaultTraceLocationRepository
.