zimfarm
zimfarm copied to clipboard
API: sqlalchemy-marshmallow dump operations are not performing a deep copy of the input object
Location: API
This is the root cause of #849
When doing a dump
on a sqlalchemy-marshmallow schema object, the operation does not perform a deep copy of the object being dumped. This has the side effect that only modifications made afterwards are performed to the same object, potentially leading to DB modifications as in #849
This must be understood more precisely (why is this visible only in GET /schedules/backup
and not in GET /schedules/{schedule_name}
and most probably reported upstream.
Or maybe we should move away from marshmallow and migrate to pydantic. It is not sure this would solve the issue anyway, and there is maybe significant work to do (marhsmallow schemas are not used only for SQLAlchemy objects but also for parsing HTTP requests bodies).