ryanw-mobile / OctoMeter

🔥Kotlin Multiplatform Desktop/Android/iOS Energy Tracker app
Other
126 stars 10 forks source link

(#227) Cache half-hourly consumption data using RoomDB in repository #232

Closed ryanw-mobile closed 3 months ago

ryanw-mobile commented 3 months ago

Adding on top of the current repository method to detect cached half-hourly consumption data, and return directly the required data from RoomDB without calling remote APIs.

Store the remote API data to RoomDB if it is half-hourly.

For views other than half-hourly, the cache will be bypassed.

This ticket contains actual working code to make Room DB really work on all platforms (debug mode).

Additional proguard rules needed for building desktop releases. This will be done in a separate ticket.

codacy-production[bot] commented 3 months ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +4.62% (target: -1.00%) :white_check_mark: 98.08%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (2e6c23fc02a21557915be3353fca68a7931cd19b) | 1905 | 1136 | 59.63% | | | Head commit (35af9aac99565565d0e37974caece4cc7ac68288) | 1964 (+59) | 1262 (+126) | 64.26% (**+4.62%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#232) | 52 | 51 | **98.08%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences


:rocket: Don’t miss a bit, follow what’s new on Codacy.

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 76.47059% with 8 lines in your changes missing coverage. Please review.

Project coverage is 59.42%. Comparing base (2e6c23f) to head (9f12a6c).

:exclamation: Current head 9f12a6c differs from pull request most recent head 35af9aa

Please upload reports for the commit 35af9aa to get more accurate results.

Files Patch % Lines
...nigami/data/repository/OctopusRestApiRepository.kt 56.25% 0 Missing and 7 partials :warning:
...bi/kunigami/domain/extensions/InstantExtensions.kt 88.88% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #232 +/- ## ========================================== + Coverage 54.99% 59.42% +4.43% ========================================== Files 97 98 +1 Lines 1822 1888 +66 Branches 281 300 +19 ========================================== + Hits 1002 1122 +120 + Misses 716 657 -59 - Partials 104 109 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.