-
Notifications
You must be signed in to change notification settings - Fork 134
[POS][Local Catalog] Repo for incremental sync timestamps #14511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
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.
Pull Request Overview
This PR implements a repository system for storing and retrieving site-specific incremental sync timestamps for POS products and variations using DataStore preferences.
- Adds a low-level repository (
WooPosSyncTimestampRepository
) for string timestamp storage with site-specific keys - Implements a high-level manager (
WooPosSyncTimestampManager
) providing Date object API with GMT timezone handling - Includes comprehensive test coverage for the timestamp manager functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
WooPosSyncTimestampRepository.kt | Low-level repository for storing/retrieving site-specific timestamps using DataStore |
WooPosSyncTimestampManager.kt | High-level manager providing Date object API with GMT formatting and parsing |
WooPosSyncTimestampManagerTest.kt | Comprehensive unit tests for the timestamp manager functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...ain/kotlin/com/woocommerce/android/ui/woopos/util/datastore/WooPosSyncTimestampRepository.kt
Show resolved
Hide resolved
...c/main/kotlin/com/woocommerce/android/ui/woopos/util/datastore/WooPosSyncTimestampManager.kt
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #14511 +/- ##
=========================================
Coverage 37.89% 37.89%
- Complexity 9362 9374 +12
=========================================
Files 2024 2026 +2
Lines 113785 113866 +81
Branches 15092 15107 +15
=========================================
+ Hits 43121 43152 +31
- Misses 66698 66747 +49
- Partials 3966 3967 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
||
suspend fun storeProductsLastSyncTimestamp(timestamp: Date) { | ||
val timestampGmt: String = gmtDateFormat.format(timestamp) | ||
timestampRepository.storeProductsLastSyncTimestamp(timestampGmt) |
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.
💡 I think storing formatted dates has some drawbacks, the main one is that we can't safely change the format without clearing the storage. I'd suggest storing just timestamps - milliseconds since 1970.
Considering Samuel is AFK, @kidinov could you double check my train of thoughts and share whether you agree with this suggestion before I make the change? Thanks!
POS Incremental Sync Timestamp Storage
Description
Summary
Implemented a repository system for storing and retrieving site-specific incremental sync timestamps for POS products and variations using DataStore preferences.
Changes
WooPosSyncTimestampRepository
: Low-level repository for string timestamp storage with site-specific keysWooPosSyncTimestampManager
: High-level manager providing Date object API with GMT timezone handlingKey Features
Steps to reproduce
Testing information
This code is not used at the moment. Check if CI is green and if the code looks good.
The tests that have been performed
Above
Images/gif
N/A
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.