Bug: Deleting a user leaves shopping list items without any reason #35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
Deleting a user deletes every shopping list item reason that user added:
shopping_list_item_reason.added_byisNOT NULLwithON DELETE CASCADE(src/entities/ShoppingListItemReasonEntity.ts, migration1780012800011-CreateShoppingListItemReasonTable.ts).An item whose only reason belonged to the deleted user is left with no reason at all. The contract (
ShoppingListItemDto.reasons) promises "Always present with at least one entry". This affects items added by hand by a user who was later deleted, e.g. on a list shared with them, and from spec 004 on also items filled by them.Found by the recipe-backend repo architect during
/plan-featurefor spec 004. It predates spec 004 (spec 001), so it is not fixed in that spec.To decide
What a reason shows once its user is gone. For example: keep the reason with a nullable
added_byand a "deleted user" display (that changes the contract, sinceaddedByis required today), or reassign it, or delete items left without a reason. A choice that changes the contract needs the cross-cutting architect.🤖 Generated with Claude Code
Deleting a user leaves shopping list items without any reasonto Bug: Deleting a user leaves shopping list items without any reason