Skip to content

Conversation

@malinajirka
Copy link
Contributor

@malinajirka malinajirka commented Oct 29, 2025

#WOOMOB-1334

Do not merge label - ensure the target branch is trunk before merging.

Description

This is the final PR in the chain of PRs that aim to ensure that both product and variation sync is done within a single transaction.

This PR is quite big - but the changes are so related that I couldnt' find a way how to split it further. Essentially we are removing WooPosSyncProductAction and WooPosSyncVariationAction and all the logic is done within WooPosSyncAction (since we removed the classes, we also need to remove all their tests and introduce new tests for WooPosSyncAction => that's the main reason for the large PR).

Considering this feature is still behind a FF and this PR doesn't touch any code outside of Local Catalog, I believe the change is safe to make.

Test Steps

Verify both initial local catalog sync as well as incremental sync work.

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.

@dangermattic
Copy link
Collaborator

dangermattic commented Oct 29, 2025

2 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ This PR is assigned to the milestone 23.6. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@malinajirka malinajirka added the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Oct 29, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 29, 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
Commit71ea3aa
Direct Downloadwoocommerce-wear-prototype-build-pr14857-71ea3aa.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 29, 2025

📲 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
Commit71ea3aa
Direct Downloadwoocommerce-prototype-build-pr14857-71ea3aa.apk

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Base automatically changed from issue/woomob-1334-woo-poslocal-catalog-run-both-products-and-variations-within-v2-step2 to trunk October 30, 2025 10:06
@samiuelson samiuelson self-assigned this Oct 30, 2025
…both-products-and-variations-within-v2-step3
Copy link
Contributor

@samiuelson samiuelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I left a couple of nonblocking comments.

}

return result
val syncDuration = System.currentTimeMillis() - startTime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 n.p.: I'm wondering if it would be better to inject the current time via DateTimeProvider and replace all 3 System::currentTimeMillis calls with DateTimeProvider::now already. Currently, it's not a big deal since we are not even asserting the syncDurationMs value in tests, but it can avoid making tests non-deterministic by accident in the future.

Copy link
Contributor Author

@malinajirka malinajirka Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 5c95269

private val logger: WooPosLogWrapper,
) {
suspend fun execute(
private suspend fun executeDatabaseTransaction(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 n.p.: The executeDatabaseTransaction name is slightly misleading, because it suggests it's some general-use DB transaction executor. Could it be something like updateDatabaseWithFetchedItems?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, fixed in 71ea3aa.

@malinajirka malinajirka removed the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Oct 30, 2025
@malinajirka malinajirka enabled auto-merge October 30, 2025 20:18
@malinajirka malinajirka merged commit e5cf073 into trunk Oct 30, 2025
19 checks passed
@malinajirka malinajirka deleted the issue/woomob-1334-woo-poslocal-catalog-run-both-products-and-variations-within-v2-step3 branch October 30, 2025 20:44
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 78.09524% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.26%. Comparing base (9c44f97) to head (71ea3aa).
⚠️ Report is 17 commits behind head on trunk.

Files with missing lines Patch % Lines
...android/ui/woopos/localcatalog/WooPosSyncAction.kt 77.64% 6 Missing and 13 partials ⚠️
...s/localcatalog/WooPosLocalCatalogSyncRepository.kt 80.00% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #14857      +/-   ##
============================================
- Coverage     38.26%   38.26%   -0.01%     
- Complexity    10077    10085       +8     
============================================
  Files          2131     2131              
  Lines        120744   120701      -43     
  Branches      16547    16537      -10     
============================================
- Hits          46207    46189      -18     
+ Misses        69840    69816      -24     
+ Partials       4697     4696       -1     

☔ 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants