You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deleting a team database reports success and audit-logs it even when the database drop failed #8849
DELETE /api/v1/teams/:teamId/databases/:databaseId answers 200 and writes a team.database.deleted audit entry even when dropping the Postgres database, user or role threw an error, in which case nothing was deleted and the database record is still there.
Steps to reproduce
Use a Postgres tables driver (localfs or supavisor).
Make one of the DROP DATABASE, DROP USER or DROP ROLE statements fail, for example by keeping a connection open to the team database while deleting it (Postgres refuses to drop a database that has active connections).
A 500 unexpected_error (the route already has this branch), no deleted audit entry for a delete that did not happen, and the database record left intact.
Actual
The driver wraps the three drops and db.destroy() in a try whose catch is empty, so destroyDatabase resolves. The route then replies {} with 200 and logs the deletion. Callers are told the data is gone while the database, its roles and its record are all still there: a GET still returns it and a create returns 409 already_exists. A later DELETE succeeds once nothing is connected.
Activity