Skip to content

Conversation

@samiuelson
Copy link
Contributor

@samiuelson samiuelson commented Oct 23, 2025

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).

  • Introduced WooPosIsLocalCatalogVariationsEndpointAvailable class to centralize version checking logic
  • Updated WooPosLocalCatalogSyncWorker to skip sync when variations endpoint is unavailable
  • Refactored WooPosFullSyncStatusChecker to use the new shared version checker

Test Steps

Verify that with the site running WC version < 10.3.0:

  • The POS falls back to the hybrid items store.
  • Local catalog sync is skipped.

Images/gif

N/A

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@samiuelson samiuelson requested a review from Copilot October 23, 2025 15:29
Copy link
Contributor

Copilot AI left a 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 WooPosIsLocalCatalogVariationsEndpointAvailable class to centralize version checking logic
  • Updates WooPosLocalCatalogSyncWorker to skip sync when variations endpoint is unavailable
  • Refactors WooPosFullSyncStatusChecker to 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.

@samiuelson samiuelson added the type: task An internally driven task. label Oct 23, 2025
@samiuelson samiuelson added this to the 23.6 milestone Oct 23, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 23, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit36b2516
Direct Downloadwoocommerce-wear-prototype-build-pr14810-36b2516.apk

@samiuelson samiuelson marked this pull request as ready for review October 23, 2025 15:48
@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit36b2516
Direct Downloadwoocommerce-prototype-build-pr14810-36b2516.apk

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.22%. Comparing base (8202604) to head (36b2516).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants