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

Conversation

@jurajkusnier
Copy link
Contributor

Move Tracing settings from LocalData to TracingSettings and implement migration in EncryptedPreferencesMigration

…ing_migration

# Conflicts:
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/LocalData.kt
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/preferences/EncryptedPreferencesMigration.kt
@jurajkusnier jurajkusnier added maintainers Tag pull requests created by maintainers prio PRs to review first. labels Mar 10, 2021
@jurajkusnier jurajkusnier added this to the 1.15.0 milestone Mar 10, 2021
@jurajkusnier jurajkusnier requested review from a team March 10, 2021 13:59
@BMItr BMItr self-assigned this Mar 10, 2021
MockKAnnotations.init(this)
every { submissionSettings.hasViewedTestResult.value } returns false
every { timeStamper.nowUTC } returns currentInstant
every { tracingSettings.initialPollingForTestResultTimeStamp } returns currentInstant.millis
Copy link
Contributor

Choose a reason for hiding this comment

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

use timestamper?

@BMItr
Copy link
Contributor

BMItr commented Mar 10, 2021

lgtm, nothing to complain so far. #oneOptionalComment

…ing_migration

# Conflicts:
#	Corona-Warn-App/src/androidTest/java/de/rki/coronawarnapp/ui/main/MainActivityTest.kt
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/LocalData.kt
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

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

11.3% 11.3% Coverage
0.0% 0.0% Duplication

@jurajkusnier jurajkusnier merged commit 5227363 into feature/2850-refactor-localdata Mar 10, 2021
@jurajkusnier jurajkusnier deleted the feature/5377-tracing_migration branch March 10, 2021 15:43
harambasicluka added a commit that referenced this pull request Mar 11, 2021
* Shared preferences migration: SETTINGS DATA (EXPOSUREAPP-5378) (#2468)

* Migrate Shared Preferences (SETTINGS)

* Code refactoring

* Fix tests

* Migrate Shared Preferences (SETTINGS)

* Cleaning code

* Cleaning code

* LocalData Migration skeleton (EXPOSUREAPP-5295) (#2509)

* EncryptedPreferencesMigration skeleton class

* SecurityHelper return nullable SharedPreferences not an exception

* Remove Onboarding related Properties from LocalData (EXPOSUREAPP-5375) #2470

* Removed Onboarding related Properties from LocalData
Added OnboardingData which provides the FlowPreferences that were defined in LocalData beforehand
Currently no migration for these values is implemented

Signed-off-by: Kolya Opahle <[email protected]>

* Turns out MockFlowPreference and MockSharedPreferences were not usable in the device test flavour
moved them into testShared

Signed-off-by: Kolya Opahle <[email protected]>

* OnboardingData -> OnboardingSettings
OnboardingSettings:
moved to get / set instead of FlowPreferences when subscribing is not needed
isOnboarded is now based on onboardingCompletedTimestamp != null instead of set seperately

Signed-off-by: Kolya Opahle <[email protected]>

* Removed Onboarding Preference key strings from all languages

Signed-off-by: Kolya Opahle <[email protected]>

* Added Singleton annotation to OnboardingSettings
Added migration code for OnboardingSettings to EncryptedPreferencesMigration

Signed-off-by: Kolya Opahle <[email protected]>

* Migrate Interoperability settings

* Remove tracing local data (EXPOSUREAPP-5377) (#2568)

* migrate LocalData tracing preferences to TracingSettings

* update tests

* Remove old code

* Update tests

* Remove submission local data (EXPOSUREAPP-5379) (#2505)

* Moved submission related settings from LocalData to SubmissionSettings
Made BackgroundNoise injectable
Refactored some of the SubmissionSettings

Signed-off-by: Kolya Opahle <[email protected]>

* Replaced isBeforeNow in BackgroundNoisePeriodicWorker with timeStamper.nowUTC to help with testing

Signed-off-by: Kolya Opahle <[email protected]>

* Fixed MainActivityTest by providing SubmissionSettings as a mockk

Signed-off-by: Kolya Opahle <[email protected]>

* Removed all Preference keys removed from LocalData

Signed-off-by: Kolya Opahle <[email protected]>

* Added migration code for SubmissionSettings to EncryptedPreferencesMigration

Signed-off-by: Kolya Opahle <[email protected]>

* Moved Instant conversion to extension function to satisfy detekt

Signed-off-by: Kolya Opahle <[email protected]>

* Removed lazy from dagger injection in BackgroundWorkSchedulerBase

* Cleaned up TestResultDonorTest (Removed Instant.now() calls, fixed shouldBe case where Instant.now() would break the calculation)

* Moved toInstantOrNull into TimeAndDateExtensions and used it in a few more places

* Fixed a unit test that was added by the merge
and fixed a merge diff that was resolved wrongly

Signed-off-by: Kolya Opahle <[email protected]>

* Format on commit got rid of these imports for some reason

Signed-off-by: Kolya Opahle <[email protected]>

* EncryptedPreferencesMigration refactoring

* DataReset implementation

* Drop storage of active tracing time

* Cleaning code

* Remove TODO

* Call migration earlier

* Update tests

* Delete PreferencesModule

* Update EncryptedPreferencesMigration

* Fix lint issue

* Update EncryptedPreferencesHelper

Co-authored-by: Kolya Opahle <[email protected]>
Co-authored-by: harambasicluka <[email protected]>
Co-authored-by: Matthias Urhahn <[email protected]>
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.

3 participants