Bug Description
ransfer_cycle_issues performs two DB writes sequentially without wrapping them in ransaction.atomic. If the process is killed or a DB error occurs after the first write completes but before the second, the database is left in an inconsistent state with no recovery path.
Affected file
�pps/api/plane/utils/cycle_transfer_issues.py:
`python
current_cycle.save(update_fields=["progress_snapshot"]) # line 432 - committed first
... build updated_cycles list ...
CycleIssue.objects.bulk_update(updated_cycles, ["cycle_id"], batch_size=100) # line 458 - may never run
`
Failure scenario
- Admin triggers "Transfer incomplete issues" from cycle A to cycle B.
- current_cycle.save(update_fields=["progress_snapshot"]) commits - cycle A now appears complete in the UI.
- Worker process is killed (OOM kill, deploy restart, DB connection timeout) before CycleIssue.objects.bulk_update runs.
- Cycle A shows as completed with a snapshot, but all its issues still belong to cycle A - they were never moved.
- Users see a "completed" cycle full of issues with no way to trigger the transfer again through the UI.
Fix
`python
from django.db import transaction
with transaction.atomic():
current_cycle.save(update_fields=["progress_snapshot"])
CycleIssue.objects.bulk_update(updated_cycles, ["cycle_id"], batch_size=100)
`
Environment
Plane develop branch (2026-08-13).
Bug Description
Affected file
�pps/api/plane/utils/cycle_transfer_issues.py:
`python
current_cycle.save(update_fields=["progress_snapshot"]) # line 432 - committed first
... build updated_cycles list ...
CycleIssue.objects.bulk_update(updated_cycles, ["cycle_id"], batch_size=100) # line 458 - may never run
`
Failure scenario
Fix
`python
from django.db import transaction
with transaction.atomic():
current_cycle.save(update_fields=["progress_snapshot"])
CycleIssue.objects.bulk_update(updated_cycles, ["cycle_id"], batch_size=100)
`
Environment
Plane develop branch (2026-08-13).