Reason: The .createMissingFoodItems sync strategy creates new food items, which are already there, and this seems to run into some kind of endless loop.
Other issues found during investigation:
Export: The UUIDs are not exported
Import: When importing a food item with an associated composed food item, the ingredients are not referenced to the existing ingredients in the FoodItem.create(from foodItemVM) function.
Storage: The ingredients of a composed food item are stored with all values instead of referencing to existing food items
When exporting as JSON, the app crashes due to a endless loop in the FoodItemViewModel.encode function, line 365:
composedFoodItemVM.fill(from: cdComposedFoodItem, syncStrategy: .createMissingFoodItems)
Reason: The .createMissingFoodItems sync strategy creates new food items, which are already there, and this seems to run into some kind of endless loop.
Other issues found during investigation:
FoodItem.create(from foodItemVM)
function.