nextcloud/cookbook

If edited multiple time (for example 4 times), the JSON file store multiple times (4 times) the different version of the Recipe

Tonic8 opened this issue · 3 comments

Description
when creating manually a recipe, after saving it, and editing it to correct or add fields, the resulting json is growing. the only field in the group of field that change is the modified time.

Reproduction
Steps to reproduce the behavior:

  1. Start a new recipe,
  2. fill the different fields
  3. Save it
  4. Edit add another field or edit a field
  5. Save it
  6. json is growing

Expected behavior
it should have the recipe one time.

Actual behavior
each time the recipe is saved, the valueInit field is filled with the previous recipe version

Screenshots
image

Browser
Chrome

Versions
Nextcloud server version: 27.1.6
Cookbook version: 0.10.5
Database system: MariaDB

Attached Recipe file
recipe.json

i also spotted that when you clone a recipe all the "history" of the cloned recipe will be copied to the new recipe.

and the there is a copy of the cloned recipe before we save the modificaiton on the cloned recipe

2024-03-02 17_30_03-D__Workspace_Nextcloud_Recettes_Crème de carottes et cumin_recipe json - Notepad

@seyfeb, this was introduced by you in this line. Was this intentional or is it a bug?

This is a bug!