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

Submit analytics date conversion (EXPOSUREAPP-12616) #5159

Merged
merged 10 commits into from
May 12, 2022

Conversation

schauersbergern
Copy link
Contributor

Using the device Timezone for toDateTimeAtStartOfDay results in a date two hours before midnight the day before.
Using UTC Timezone results in midnight of the same day

@schauersbergern schauersbergern added bug Something isn't working maintainers Tag pull requests created by maintainers labels May 9, 2022
@schauersbergern schauersbergern added this to the 2.23.x milestone May 9, 2022
@schauersbergern schauersbergern requested a review from a team May 9, 2022 07:23
@chiljamgossow chiljamgossow self-assigned this May 9, 2022
@@ -74,7 +75,7 @@ class ExposureRiskMetadataDonor @Inject constructor(
val riskLevelPtForMetadata = lastPTRiskResult.toMetadataRiskLevel()
val mostRecentDateAtPtRiskLevel = lastPTRiskResult
.mostRecentDateAtRiskState
?.toDateTimeAtStartOfDay()
?.toDateTimeAtStartOfDay(DateTimeZone.UTC)
?.toInstant()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a unit test for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, unit test added

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the test. Can you add one for the donor to make sure this is and stays fixed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed present tests to use toDateTimeAtStartOfDayUtc

@SamuraiKek SamuraiKek self-assigned this May 10, 2022
@sonarcloud
Copy link

sonarcloud bot commented May 11, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

75.0% 75.0% Coverage
0.0% 0.0% Duplication

@SamuraiKek SamuraiKek merged commit 268ae38 into release/2.23.x May 12, 2022
@SamuraiKek SamuraiKek deleted the fix/12616-date_conversion branch May 12, 2022 07:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants