Bulk operations aren't actually atomic despite the docblock claiming so #33

Open
opened 2026-08-31 21:29:42 -04:00 by jared · 0 comments
Owner

Severity: Medium

models/BulkOperationsModel.php::processBulkOperation() (~line 99 docblock) states the transaction "ensures atomicity — either all tickets are updated or none are (rolled back on failure)" — but this only happens when $atomic = true is passed. The only real caller, api/bulk_operation.php (~line 106), never passes it, so it defaults to false.

Impact: In production, a bulk operation with partial per-ticket failures (e.g. 8 succeed, 2 hit a disallowed workflow transition) commits the 8 successes anyway — actual behavior is best-effort, not atomic, contradicting the documented contract. Admins performing a bulk action may believe it's all-or-nothing when it isn't.

Fix: Either pass $atomic = true from api/bulk_operation.php if all-or-nothing is the desired UX, or fix the docblock to accurately describe the default best-effort behavior and surface partial-failure results clearly to the admin.

**Severity:** Medium `models/BulkOperationsModel.php::processBulkOperation()` (~line 99 docblock) states the transaction "ensures atomicity — either all tickets are updated or none are (rolled back on failure)" — but this only happens when `$atomic = true` is passed. The only real caller, `api/bulk_operation.php` (~line 106), never passes it, so it defaults to `false`. **Impact:** In production, a bulk operation with partial per-ticket failures (e.g. 8 succeed, 2 hit a disallowed workflow transition) commits the 8 successes anyway — actual behavior is best-effort, not atomic, contradicting the documented contract. Admins performing a bulk action may believe it's all-or-nothing when it isn't. **Fix:** Either pass `$atomic = true` from `api/bulk_operation.php` if all-or-nothing is the desired UX, or fix the docblock to accurately describe the default best-effort behavior and surface partial-failure results clearly to the admin.
jared added the priority/mediumreliability labels 2026-09-08 10:15:43 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/tinker_tickets#33