Skip to content
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

[Woo POS][non-simple products] Remove empty filters condition from deleting stale products from database #3114

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

AnirudhBhat
Copy link
Contributor

@AnirudhBhat AnirudhBhat commented Nov 27, 2024

Please review the corresponding WooCommerce PR after reviewing and merging this one

This PR removes empty filter condition which was one among few conditions we were checking before removing stale products from the database before inserting new ones fetched from the remote.

This was done since for POS, when we fetch products, there always will be filter applied for products (simple + variable) unless we support all types of products in POS. Since from POS, we won't be having an empty filter, the stale products in the database weren't being removed.

@AnirudhBhat AnirudhBhat changed the title Remove empty filters condition from deleting stale products from database [Woo POS][non-simple products] Remove empty filters condition from deleting stale products from database Nov 27, 2024
@AnirudhBhat AnirudhBhat marked this pull request as ready for review November 28, 2024 03:36
@samiuelson samiuelson self-assigned this Nov 28, 2024
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 one question.

@@ -1604,8 +1604,7 @@ class WCProductStore @Inject constructor(
if (forceRefresh &&
offset == 0 &&
includedProductIds.isEmpty() &&
excludedProductIds.isEmpty() &&
filterOptions.isEmpty()
excludedProductIds.isEmpty()
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ Does it affect the Product screen in store management?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes and no.

Yes, because we have removed filterOptions.isEmpty() condition that was a requirement earlier before we deleted products.

No, because AFAIU, there will not be any behavioural changes in the products screen because of this. When we apply any filter on the products screen and pull to refresh, we delete and then upsert products now instead of just upserting product.

@AnirudhBhat AnirudhBhat merged commit 3d45586 into trunk Nov 29, 2024
13 checks passed
@AnirudhBhat AnirudhBhat deleted the issue/13015-remove-stale-products branch November 29, 2024 06:38
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.

2 participants