-
Notifications
You must be signed in to change notification settings - Fork 120
[Local Catalog] Filter trashed products #16361
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
Open
joshheald
wants to merge
20
commits into
issue/woomob-1686-local-catalog-handle-errors-from-order-creation-with
Choose a base branch
from
issue/woomob-1493-local-catalog-filter-trashed-products
base: issue/woomob-1686-local-catalog-handle-errors-from-order-creation-with
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Local Catalog] Filter trashed products #16361
joshheald
wants to merge
20
commits into
issue/woomob-1686-local-catalog-handle-errors-from-order-creation-with
from
issue/woomob-1493-local-catalog-filter-trashed-products
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…yncRemote 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…arameter 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Add tests verifying include_status parameter is correctly added/omitted - Add test verifying status is included in _fields request parameter - Update MockPOSCatalogSyncRemote to support includeStatus parameter - Update test fixtures to include required statusKey field 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Add tests verifying both regular and trashed products are fetched - Add test ensuring same modifiedAfter date is used for both requests - Add test verifying includeStatus parameter values - Add tests for combined persistence of regular and trashed products - Add tests for edge cases (empty trash, only trash updates) - Enhance MockPOSCatalogSyncRemote to support separate trashed product results 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Replace non-thread-safe array append with actor-based IncludeStatusTracker to prevent EXC_BAD_ACCESS crash when concurrent requests modify the array. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add "status": "publish" to product fixtures that were missing the field, fixing decoding errors in POSCatalogSyncRemoteTests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Wrap single product objects in {"data": [...]} envelope to match
standard WooCommerce REST API response format expected by tests.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Add statusKey field with default value "publish" to TestProduct struct to match updated PersistedProduct schema, fixing NOT NULL constraint errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Collaborator
|
|
The catalog download parser decodes all items as POSProduct first before filtering by type, so variations also need the status field to avoid decoding errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Merge after: #16353
Description
This PR ensures that trashed products are removed from POS after an incremental sync.
We already hide them if they're trashed when we do a full sync – because the API doesn't return them for a normal request. However, that works against us if they've been trashed when we do an incremental sync, because the newly-trashed product won't be returned for those requests either.
To resolve that, we do an extra request for any newly trashed products, and include those in the local database. When we've done that, we filter those products from all our queries.
Note that Variations can't be trashed, they just get deleted.
Test Steps
Set up a new product with a GTIN that you can scan with a barcode scanner
Not founderror is shown, same as for deleted productsSearch isn't affected by this, as it doesn't use the local catalog yet.
Fully deleted products are still not removed by incremental sync, but will be by the next full sync. Without extensive backend work, this is unavoidable.
Screenshots
This shows:
trashed.products.mp4
RELEASE-NOTES.txtif necessary.