Skip to content
This repository was archived by the owner on Sep 14, 2024. It is now read-only.
This repository was archived by the owner on Sep 14, 2024. It is now read-only.

Problem adding ingredients, instructions, or tools to recipes #204

@arroyoj

Description

@arroyoj

While testing the current development version, I came across a problem where ingredients, instructions, and tools could not be added to either new or existing recipes. The issue only seemed to affect those recipe fields that are stored as arrays.

Here is the flutter log after loading a test recipe:

I/flutter (12317): RecipeLoaded(11887)
I/flutter (12317): Transition { currentState: RecipeState(RecipeStatus.loadInProgress, null, null, null), event: RecipeLoaded(11887), nextState: RecipeState(RecipeStatus.loadSuccess, null, Recipe {
I/flutter (12317):   id=11887,
I/flutter (12317):   cookTime=1:00:00.000000,
I/flutter (12317):   totalTime=1:30:00.000000,
I/flutter (12317):   description=This is a recipe for app testing,
I/flutter (12317):   url=https://github.com/nextcloud/cookbook,
I/flutter (12317):   image=,
I/flutter (12317):   recipeYield=6,
I/flutter (12317):   recipeCategory=,
I/flutter (12317):   tool=[Tool 1, Tool 2, Tool 3],
I/flutter (12317):   recipeIngredient=[## Ingredient Group, Ingredient 1, Ingredient 2, Ingredient 3],
I/flutter (12317):   recipeInstructions=[Instruction step 1, Instruction step 2, Instruction step 3],
I/flutter (12317):   nutrition=Nutrition {
I/flutter (12317):   },
I/flutter (12317):   name=Test Recipe,
I/flutter (12317):   keywords=,
I/flutter (12317):   dateCreated=2022-03-08 13:09:27.000Z,
I/flutter (12317):   dateModified=2023-05-06 12:22:46.000Z,
I/flutter (12317):   imageUrl=/apps/cookbook/webapp/recipes/11887/image?size=full,
I/flutter (12317):   imagePlaceholderUrl=,
I/flutter (12317): }, null) }

I then edited the recipe to add a fourth item to the ingredients, instructions, and tools lists as well as updating the recipe title and yield and got the following log:

I/flutter (12317): RecipeUpdated(Recipe {
I/flutter (12317):   id=11887,
I/flutter (12317):   cookTime=1:00:00.000000,
I/flutter (12317):   totalTime=1:30:00.000000,
I/flutter (12317):   description=This is a recipe for app testing,
I/flutter (12317):   url=https://github.com/nextcloud/cookbook,
I/flutter (12317):   image=,
I/flutter (12317):   recipeYield=4,
I/flutter (12317):   recipeCategory=,
I/flutter (12317):   tool=[Tool 1, Tool 2, Tool 3],
I/flutter (12317):   recipeIngredient=[## Ingredient Group, Ingredient 1, Ingredient 2, Ingredient 3],
I/flutter (12317):   recipeInstructions=[Instruction step 1, Instruction step 2, Instruction step 3],
I/flutter (12317):   nutrition=Nutrition {
I/flutter (12317):   },
I/flutter (12317):   name=Test Recipe edited,
I/flutter (12317):   keywords=,
I/flutter (12317):   dateCreated=2022-03-08 13:09:27.000Z,
I/flutter (12317):   dateModified=2023-05-09 02:38:24.552454Z,
I/flutter (12317):   imageUrl=/apps/cookbook/webapp/recipes/11887/image?size=full,
I/flutter (12317):   imagePlaceholderUrl=,
I/flutter (12317): })
I/flutter (12317): Transition { currentState: RecipeState(RecipeStatus.loadSuccess, null, Recipe {
I/flutter (12317):   id=11887,
I/flutter (12317):   cookTime=1:00:00.000000,
I/flutter (12317):   totalTime=1:30:00.000000,
I/flutter (12317):   description=This is a recipe for app testing,
I/flutter (12317):   url=https://github.com/nextcloud/cookbook,
I/flutter (12317):   image=,
I/flutter (12317):   recipeYield=6,
I/flutter (12317):   recipeCategory=,
I/flutter (12317):   tool=[Tool 1, Tool 2, Tool 3],
I/flutter (12317):   recipeIngredient=[## Ingredient Group, Ingredient 1, Ingredient 2, Ingredient 3],
I/flutter (12317):   recipeInstructions=[Instruction step 1, Instruction step 2, Instruction step 3],
I/flutter (12317):   nutrition=Nutrition {
I/flutter (12317):   },
I/flutter (12317):   name=Test Recipe,
I/flutter (12317):   keywords=,
I/flutter (12317):   dateCreated=2022-03-08 13:09:27.000Z,
I/flutter (12317):   dateModified=2023-05-06 12:22:46.000Z,
I/flutter (12317):   imageUrl=/apps/cookbook/webapp/recipes/11887/image?size=full,
I/flutter (12317):   imagePlaceholderUrl=,
I/flutter (12317): }, null), event: RecipeUpdated(Recipe {
I/flutter (12317):   id=11887,
I/flutter (12317):   cookTime=1:00:00.000000,
I/flutter (12317):   totalTime=1:30:00.000000,
I/flutter (12317):   description=This is a recipe for app testing,
I/flutter (12317):   url=https://github.com/nextcloud/cookbook,
I/flutter (12317):   image=,
I/flutter (12317):   recipeYield=4,
I/flutter (12317):   recipeCategory=,
I/flutter (12317):   tool=[Tool 1, Tool 2, Tool 3],
I/flutter (12317):   recipeIngredient=[## Ingredient Group, Ingredient 1, Ingredient 2, Ingredient 3],
I/flutter (12317):   recipeInstructions=[Instruction step 1, Instruction step 2, Instruction step 3],
I/flutter (12317):   nutrition=Nutrition {
I/flutter (12317):   },
I/flutter (12317):   name=Test Recipe edited,
I/flutter (12317):   keywords=,
I/flutter (12317):   dateCreated=2022-03-08 13:09:27.000Z,
I/flutter (12317):   dateModified=2023-05-09 02:38:24.552454Z,
I/flutter (12317):   imageUrl=/apps/cookbook/webapp/recipes/11887/image?size=full,
I/flutter (12317):   imagePlaceholderUrl=,
I/flutter (12317): }), nextState: RecipeState(RecipeStatus.updateInProgress, null, null, null) }
I/AssistStructure(12317): Flattened final assist data: 512 bytes, containing 1 windows, 3 views
I/flutter (12317): Transition { currentState: RecipeState(RecipeStatus.updateInProgress, null, null, null), event: RecipeUpdated(Recipe {
I/flutter (12317):   id=11887,
I/flutter (12317):   cookTime=1:00:00.000000,
I/flutter (12317):   totalTime=1:30:00.000000,
I/flutter (12317):   description=This is a recipe for app testing,
I/flutter (12317):   url=https://github.com/nextcloud/cookbook,
I/flutter (12317):   image=,
I/flutter (12317):   recipeYield=4,
I/flutter (12317):   recipeCategory=,
I/flutter (12317):   tool=[Tool 1, Tool 2, Tool 3],
I/flutter (12317):   recipeIngredient=[## Ingredient Group, Ingredient 1, Ingredient 2, Ingredient 3],
I/flutter (12317):   recipeInstructions=[Instruction step 1, Instruction step 2, Instruction step 3],
I/flutter (12317):   nutrition=Nutrition {
I/flutter (12317):   },
I/flutter (12317):   name=Test Recipe edited,
I/flutter (12317):   keywords=,
I/flutter (12317):   dateCreated=2022-03-08 13:09:27.000Z,
I/flutter (12317):   dateModified=2023-05-09 02:38:24.552454Z,
I/flutter (12317):   imageUrl=/apps/cookbook/webapp/recipes/11887/image?size=full,
I/flutter (12317):   imagePlaceholderUrl=,
I/flutter (12317): }), nextState: RecipeState(RecipeStatus.updateSuccess, null, null, 11887) }
I/flutter (12317): RecipeLoaded(11887)
I/flutter (12317): Transition { currentState: RecipeState(RecipeStatus.updateSuccess, null, null, 11887), event: RecipeLoaded(11887), nextState: RecipeState(RecipeStatus.loadSuccess, null, Recipe {
I/flutter (12317):   id=11887,
I/flutter (12317):   cookTime=1:00:00.000000,
I/flutter (12317):   totalTime=1:30:00.000000,
I/flutter (12317):   description=This is a recipe for app testing,
I/flutter (12317):   url=https://github.com/nextcloud/cookbook,
I/flutter (12317):   image=,
I/flutter (12317):   recipeYield=4,
I/flutter (12317):   recipeCategory=,
I/flutter (12317):   tool=[Tool 1, Tool 2, Tool 3],
I/flutter (12317):   recipeIngredient=[## Ingredient Group, Ingredient 1, Ingredient 2, Ingredient 3],
I/flutter (12317):   recipeInstructions=[Instruction step 1, Instruction step 2, Instruction step 3],
I/flutter (12317):   nutrition=Nutrition {
I/flutter (12317):   },
I/flutter (12317):   name=Test Recipe edited,
I/flutter (12317):   keywords=,
I/flutter (12317):   dateCreated=2022-03-08 13:09:27.000Z,
I/flutter (12317):   dateModified=2023-05-09 02:38:31.000Z,
I/flutter (12317):   imageUrl=/apps/cookbook/webapp/recipes/11887/image?size=full,
I/flutter (12317):   imagePlaceholderUrl=,
I/flutter (12317): }, null) }

While the title and yield were updated, the other ingredients, instructions, and tools were not changed. I also tried deleting items from those lists, and that did not work either, even if that was the only change being made. Although not shown here, I ran into the same problem when creating a new recipe: the values in arrays were not added, while other values were.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions