fix(auth): erase plugin user data in the transaction that deletes the user

erasePluginUserData deleted the host-side plugin rows and then queued the
plugin erasures as separate commits, and deleteGuest ran it before its own
transaction. When the guest delete failed, the guest kept its account but had
lost its plugin rows, with erasures queued for a user that still exists. The
erasure is now one transaction, and deleteGuest runs it inside the same
transaction as the budget re-split and the user delete, so it becomes a
savepoint of that write. Only DB writes and a synchronous readdir run inside.
This commit is contained in:
Maurice
2026-10-08 15:56:09 +02:00
parent b7e13e4af6
commit 36a0d1eaba
4 changed files with 58 additions and 25 deletions
-2
View File
@@ -8,7 +8,6 @@
"src/nest/auth/passkey.service.ts#PasskeyService.passkeyLoginVerify": 2,
"src/nest/auth/passkey.service.ts#PasskeyService.passkeyRegisterOptions": 2,
"src/nest/auth/passkey.service.ts#PasskeyService.passkeyRegisterVerify": 2,
"src/nest/auth/user-cleanup.service.ts#UserCleanupService.erasePluginUserData": 2,
"src/nest/booking-import/booking-import.service.ts#BookingImportService.confirm": 4,
"src/nest/doc-sync/doc-sync-config.service.ts#DocSyncConfigService.upsertConnection": 3,
"src/nest/doc-sync/doc-sync.controller.ts#DocSyncController.createLink": 4,
@@ -97,7 +96,6 @@
"src/nest/plugins/plugins.controller.ts#PluginsController.update": 2,
"src/nest/plugins/plugins.controller.ts#PluginsController.updateConfig": 3,
"src/nest/reservations/reservations.controller.ts#ReservationsController.update": 2,
"src/nest/trip-members/trip-members.service.ts#TripMembersService.deleteGuest": 2,
"src/nest/trips/trips.service.ts#TripsService.update": 2,
"src/nest/vacay/vacay.service.ts#VacayService.updatePlan": 2
}