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

Automation not running on first ingredient #2927

Closed
tomtjes opened this issue Feb 2, 2024 · 5 comments · Fixed by #2937
Closed

Automation not running on first ingredient #2927

tomtjes opened this issue Feb 2, 2024 · 5 comments · Fixed by #2937

Comments

@tomtjes
Copy link
Contributor

tomtjes commented Feb 2, 2024

Tandoor Version

1.5.12

Setup

Docker / Docker-Compose

Reverse Proxy

SWAG

Other

No response

Bug description

A food replace automation (and possibly other types too) doesn't get applied to the first food in a recipe's ingredient list.

Steps to reproduce:

  • create food replace automation with parameter 1 = .*, parameter 2 = pasta, parameter 3 = potatoes, order=1
  • import recipe from source:
{
  "name": "Pasta",
  "recipeIngredient": [
    "200g pasta",
    "200g pasta",
    "200g pasta",
    "200g pasta"
  ],
  "recipeInstructions": [
    {
      "@type": "HowToStep",
      "text": "Cook the penne pasta in a large pot of boiling salted water until al dente, according to package instructions."
    }
  ]
}

result:
Screenshot 2024-02-02 at 13 58 41
Pasta has been replaced in all occasions except the first.

Relevant logs

No response

@vabene1111
Copy link
Collaborator

That is strange, will take a look, should probably also add a test not only for the individual parts but also some. Examples like this one

@vabene1111
Copy link
Collaborator

interesting, I could have sworn I reproduced this on the first test but its working fine for both food replace and food alias.

image

image

Can you post a picture of your automation / try again to see if anything might be different? Automations do use caching to some degree so that must be taken into account.

@tomtjes
Copy link
Contributor Author

tomtjes commented Feb 6, 2024

Spun up a new instance: it works. On my production instance: still no luck.

@smilerz
Copy link
Collaborator

smilerz commented Feb 6, 2024

Are there other automations on pasta?

@tomtjes
Copy link
Contributor Author

tomtjes commented Feb 6, 2024

Pasta was just a simplified example after I noticed that a more complex automation didn't affect a first ingredient of a recipe.

Here's one that shouldn't interfere with anything else.

Screenshot 2024-02-06 at 11 20 05

{
  "name": "Pasta",
  "recipeIngredient": [
    "100g 123456",
    "200g 123456",
    "300g 123456",
    "400g 123456"
  ],
  "recipeInstructions": [
    {
      "@type": "HowToStep",
      "text": "Cook the penne pasta in a large pot of boiling salted water until al dente, according to package instructions."
    }
  ]
}

Screenshot 2024-02-06 at 11 18 20

Same result whether the order parameter is 100 or 9000.

Edit: I now also tested other types of automations (Food Alias, Unit Replace, Transpose Words), they all work as expected. Only Food Replace still shows the described behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants