-
Notifications
You must be signed in to change notification settings - Fork 135
[Woo POS][Local Catalog] Track local_catalog_sync_skipped event
#14986
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] Track local_catalog_sync_skipped event
#14986
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #14986 +/- ##
============================================
+ Coverage 38.52% 38.54% +0.02%
- Complexity 10268 10270 +2
============================================
Files 2160 2160
Lines 122496 122533 +37
Branches 16864 16864
============================================
+ Hits 47189 47228 +39
+ Misses 70518 70517 -1
+ Partials 4789 4788 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ync-tracking-event
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 comprehensive analytics tracking for the local_catalog_sync_skipped event in WooCommerce POS, enabling monitoring of when and why catalog synchronization operations are being skipped. The implementation tracks both full and incremental sync skip scenarios with specific reason codes where applicable.
Key changes:
- Introduced
LocalCatalogSyncSkippedanalytics event withsync_typeparameter and optionalskip_reasonenum - Added five skip reason constants to categorize why syncs are skipped (POS inactive, sync not required, catalog disabled, sync check failed, no site selected)
- Implemented analytics tracking in full sync worker with specific skip reasons for all scenarios
- Implemented analytics tracking in incremental sync handler (without specific skip reasons)
- Added comprehensive test coverage verifying analytics tracking in all skip scenarios
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| WooPosAnalyticsEvent.kt | Added LocalCatalogSyncSkipped event class with sync type and optional skip reason properties |
| WooPosAnalyticsEventConstant.kt | Defined SyncSkipReason enum with five skip reason constants |
| WooPosLocalCatalogSyncWorker.kt | Integrated analytics tracking for all full sync skip scenarios with specific reasons |
| WooPosPerformLocalCatalogIncrementalSync.kt | Added analytics tracking for incremental sync skip scenarios without specific reasons |
| WooPosLocalCatalogSyncWorkerTest.kt | Updated tests to verify analytics tracking in all full sync skip cases, including new edge case test |
| WooPosPerformLocalCatalogIncrementalSyncTest.kt | Refactored test structure and added analytics tracking verification for all incremental sync skip cases |
| WooPosProductsDataSourceTest.kt | Minor test update to use more descriptive error message |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...n/com/woocommerce/android/ui/woopos/localcatalog/WooPosPerformLocalCatalogIncrementalSync.kt
Outdated
Show resolved
Hide resolved
...n/com/woocommerce/android/ui/woopos/localcatalog/WooPosPerformLocalCatalogIncrementalSync.kt
Outdated
Show resolved
Hide resolved
Update `WooPosPerformLocalCatalogIncrementalSync` to report why an incremental sync was skipped (e.g. no network, no site selected, or feature disabled). Move pre-sync checks inside the coroutine scope to allow suspendable tracking and update unit tests.
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
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Adds analytics tracking for the
local_catalog_sync_skippedevent in WooCommerce POS to monitor when and why local catalog synchronization is being skipped. This helps identify potential issues with sync operations and understand sync behavior patterns.WOOMOB-1680
Key changes:
LocalCatalogSyncSkippedanalytics event withsync_typeand optionalskip_reasonpropertiesWooPosLocalCatalogSyncWorkerfor full sync skip scenariosWooPosPerformLocalCatalogIncrementalSyncfor incremental sync skip scenariosPOS_NOT_OPENED_30_DAYS- POS hasn't been used recentlySYNC_NOT_REQUIRED- Catalog was recently syncedLOCAL_CATALOG_DISABLED- Local catalog feature is disabled (e.g., catalog too large)CHECKING_SYNC_REQUIREMENT_FAILED- Failed to determine sync requirements (e.g., no network)SITE_NOT_SELECTED- No site is currently selectedTest Steps
You can adjust intervals in
WooPosLocalCatalogSyncSchedulerandWooPosPeriodicSyncFacadeto make full/incremental sync attempts more frequent.🔵 Tracked: woocommerceandroid_pos_local_catalog_sync_skipped, Properties: {"sync_type":"full"}event is tracked🔵 Tracked: woocommerceandroid_pos_local_catalog_sync_skipped, Properties: {"sync_type":"incremental"}event is trackedRELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.