[MAJOR] Race condition in default layout setting #46

Closed
opened 2026-01-29 18:52:07 +00:00 by jason.woltje · 0 comments
Owner

In layouts.service.ts, setting isDefault has a race condition when setting/unsetting default layouts.

Need to use Prisma transaction to ensure atomicity:

  1. Start transaction
  2. Unset isDefault=false on all layouts for current user
  3. Set isDefault=true on the target layout
  4. Commit transaction

File affected:

  • src/layouts/layouts.service.ts
In layouts.service.ts, setting `isDefault` has a race condition when setting/unsetting default layouts. Need to use Prisma transaction to ensure atomicity: 1. Start transaction 2. Unset isDefault=false on all layouts for current user 3. Set isDefault=true on the target layout 4. Commit transaction File affected: - src/layouts/layouts.service.ts
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#46