-
Notifications
You must be signed in to change notification settings - Fork 138
[WOOMOB-2061] Add analytics tracking for file-based catalog sync #15288
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?
Changes from all commits
8ff12c6
0cf6419
7ed8ba8
dd5c0a1
d6c1bac
156eb30
a8b90d7
d564a77
585d1ff
286cae3
fb649df
43101d9
1521985
c617c1a
8c261aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,7 +134,9 @@ class WooPosLocalCatalogSyncRepository @Inject constructor( | |
| variationsSynced = result.variationsSynced, | ||
| totalProducts = totalProducts, | ||
| totalVariations = totalVariations, | ||
| syncDurationMs = result.syncDurationMs | ||
| syncDurationMs = result.syncDurationMs, | ||
| generationDurationMs = result.generationDurationMs, | ||
| pollAttempts = result.pollAttempts | ||
| ) | ||
| ) | ||
| } | ||
|
|
@@ -152,12 +154,16 @@ class WooPosLocalCatalogSyncRepository @Inject constructor( | |
| is PosLocalCatalogSyncResult.Failure.CatalogGenerationTimeout -> SyncErrorType.CATALOG_GENERATION_TIMEOUT | ||
| } | ||
|
|
||
| val timeoutResult = result as? PosLocalCatalogSyncResult.Failure.CatalogGenerationTimeout | ||
|
|
||
| analyticsTracker.track( | ||
| LocalCatalogSyncFailed( | ||
| syncType = syncType, | ||
| errorContext = "WooPosLocalCatalogSyncRepository", | ||
| errorType = errorType, | ||
| errorDescription = result.error | ||
| errorDescription = result.error, | ||
| lastGenerationState = timeoutResult?.lastGenerationState, | ||
| pollAttempts = timeoutResult?.pollAttempts | ||
|
Comment on lines
+157
to
+166
|
||
| ) | ||
| ) | ||
| } | ||
|
|
||
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.
getAndClearFileBasedSyncPollAttempts()clears the persisted counter at the start of a run, but most non-timeout failure paths (e.g., consecutive network failures, download/parse/store failures, missing URL) return without re-persisting the updated count. This can drop previously accumulated attempts and defeats the “accumulated across app restarts” behavior. Consider reading without clearing, incrementing as you poll, and only clearing on successful completion (or re-saving the latest total on any early exit/failure).