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

prevent tagging existing products when first seen by task #297

Merged

Conversation

tekhaus
Copy link
Collaborator

@tekhaus tekhaus commented Nov 12, 2023

This update was suggested by a merchant who noted that when the bulk scan task runs for the first time, the task will tag all existing products that were already in stock.

To prevent this, a "first seen" timestamp metafield value is now added to a product when it is first encountered by the task (in any run mode). New logic was added to prevent adding tags to products unless their "first seen" date is older than their "back in stock" date.

That logic however would prevent newly created products from being tagged, so on product creation events only, the "first seen" metafield value is set to the product creation date. This allows the first back in stock timestamp set on the new product to always be newer, and thus the product would be tagged.

@tekhaus tekhaus merged commit f58348f into lightward:main Nov 12, 2023
2 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant