fix: add recipe ingredients to catalog synchronously with async AI enrichment #32
No reviewers
Labels
No labels
needs-gherkin
type/bug
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
psycodepath/hrp!32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bugfix/31-ingredients-catalog"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the bug where creating a recipe never added its ingredients to the product catalog.
Root cause
Commit
070542dchanged the recipe listener from a synchronous catalog write to enqueue-only, moving the actual insert into thegrocery:process-taxonomyworker — but nothing ever ran that worker, sopending_taxonomy_itemsnever drained.Fix (hybrid)
RegisterRecipeIngredientsInCatalogListenernow saves a minimalCatalogProductimmediately (deduped by stemmed name, resilient per-ingredient), then queues it for enrichment. The catalog is correct the instant a recipe is saved, even if the worker/Gemini is down.TaxonomySuggestorenriches the existing product in place (reusing its id — no duplicates) with category, shelf life, and canonical unit.workerservice indocker-compose.ymlpollsgrocery:process-taxonomy(interval viaWORKER_INTERVAL, default 60s).Tests & verification
features/recipe_ingredients_catalog.feature) driving the real listener + repository + suggestor — 3 scenarios, all passing.Docs
Updated
docs/modules/grocery.md,docs/cli.md,docs/installation.md, anddocs/modules/meals.mdto reflect the hybrid flow and the new worker service.Out of scope (follow-ups, noted in #31)
Recipe::updateDetailsemits no event).tenants.json, falls back todefault).Closes #31