Closed as not planned
Description
A bug was found in dbfake
because the returned template
has a map
field. This map field was modified in the api route. The modification was not done in a database call, but just adding key/value to the map. This modification was then reflected in the db, even though no db calls was had.
The issue is our dbfake
can return structs, that when modified, are also modified in the dbfake
memory store. We should return copies of data, such that no external modifications are mirrored in the database.
See: #6679
Ideas
- A linter to prevent returning any struct with possible reference fields? Maps + Slices could be an issue?
- Some sort of "DeepCopy()" or "Clone" func on all types? (Ugly 😢)
Metadata
Metadata
Assignees
Labels
No labels