-
Notifications
You must be signed in to change notification settings - Fork 133
[Woo POS][Local Catalog] Skip catalog sync in case variations endpoint is not available #14810
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?
[Woo POS][Local Catalog] Skip catalog sync in case variations endpoint is not available #14810
Conversation
…round-full-sync-if-wc-version
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 adds a version check to skip catalog synchronization when the WooCommerce variations endpoint is not available. The change extracts the version checking logic into a dedicated class and applies it in both the sync worker and the full sync status checker to prevent sync attempts on unsupported WooCommerce versions (below 10.3.0).
- Introduces
WooPosIsLocalCatalogVariationsEndpointAvailableclass to centralize version checking logic - Updates
WooPosLocalCatalogSyncWorkerto skip sync when variations endpoint is unavailable - Refactors
WooPosFullSyncStatusCheckerto use the new shared version checker
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| WooPosIsLocalCatalogVariationsEndpointAvailable.kt | New class that checks if WooCommerce version supports variations endpoint (≥10.3.0) |
| WooPosLocalCatalogSyncWorker.kt | Adds early return when variations endpoint is not available |
| WooPosFullSyncStatusChecker.kt | Refactored to use the new shared version checker instead of internal implementation |
| WooPosLocalCatalogSyncWorkerTest.kt | Adds test coverage for version checking behavior in sync worker |
| WooPosFullSyncStatusCheckerTest.kt | Updates tests to use the new version checker class |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...rc/main/kotlin/com/woocommerce/android/ui/woopos/localcatalog/WooPosFullSyncStatusChecker.kt
Show resolved
Hide resolved
...st/kotlin/com/woocommerce/android/ui/woopos/localcatalog/WooPosLocalCatalogSyncWorkerTest.kt
Outdated
Show resolved
Hide resolved
📲 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #14810 +/- ##
=========================================
Coverage 38.22% 38.22%
- Complexity 10081 10083 +2
=========================================
Files 2131 2132 +1
Lines 120391 120398 +7
Branches 16480 16481 +1
=========================================
+ Hits 46015 46020 +5
- Misses 69720 69722 +2
Partials 4656 4656 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
WOOMOB-1557
Description
This PR adds a version check to skip catalog synchronization when the WooCommerce variations endpoint is not available. The change extracts the version checking logic into a dedicated class and applies it in both the sync worker and the full sync status checker to prevent sync attempts on unsupported WooCommerce versions (below 10.3.0).
Test Steps
Verify that with the site running WC version < 10.3.0:
Images/gif
N/A
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.