# Implementation AGILE-322 - Implement server support for optimistic reordering

Project: Stream agile
Status: closed
URL: https://community.openproject.org/work_packages/AGILE-322

## OPEN POINTS

_No work packages_

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Designer |  |
| Developers |  |

## Technical details

| Attribute | Value |
| --- | --- |
| Target versions | 17.7.0 |
| Module |  |
| Requires doc change | No |

## Belongs to

_No work packages_

## Previous chunks

_No work packages_

## Next chunks

_No work packages_

## Estimates

| Attribute | Value |
| --- | --- |
| Effort (shirt size) |  |
| Work |  |

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| % Complete | 100% |
| Category |  |
| Sprint |  |
| Backlog bucket |  |
| Priority | Medium |
| List |  |
| Pull preview |  |
| Labels |  |

## Description

Implement server support for optimistic drag-and-drop reordering in backlogs. Drag moves are applied in the client DOM first, then persisted through the existing backlogs move endpoint with an explicit optimistic flag so the server can decide when a full backlogs frame reload is unnecessary.

Expected behavior:

- Same-list drag moves persist the new position and avoid reloading the whole backlogs frame when the server can safely accept the optimistic order.
- Cross-list drag moves and menu/dialog moves keep the existing frame reload behavior so list membership, visibility, and flash messages stay reconciled.
- The work package list update and position update are atomic: a failure while assigning the final position must roll back the whole move.
- Successful moves still dispatch the backlogs work-package-moved event so split-view lock_version state can refresh.

Important edge cases to cover:

- Stale or invalid prev_id must not leave the client showing an optimistic order that differs from persisted server order; reload/reconcile in that case.
- Existing query parameters from the turbo frame must be preserved when building the move request URL.
- Absolute move URL templates, if supported by the generic sortable-lists controller, should keep their origin when optimistic=true is added.
- Non-drag move paths must remain unflagged so they continue to receive the normal reload response.
