phproject
phproject copied to clipboard
Store backlog items as individual rows with sort orders
This allows us to save backlog sort orders on an individual level, which helps prevent conflicts from multiple users updating the backlog at the same time. This could be implemented by running an UPDATE ... WHERE sort > ?
query, moving any items below the new item's position down by 1.
An implementation of this is working on the v1.7-new-backlog
branch, but has negative side effects where sort indexes can get incorrectly adjusted.
To reproduce this invalid behavior:
- Have a sprint with a few projects in it
- Add a project to a sprint by editing, rather than through the backlog
- Move an item to the bottom of the sprint on the backlog page
- Reload the page -- the item not added via the backlog will still show below the item that was moved to the bottom
This could be fixed by doing something like checking that all items in the sprint/backlog have issue_backlog
entries every time an item is updated. A performant way to do that would be sending an array of items without an index with each AJAX call to the update endpoint, and using a bulk insert query to add them. It would also be necessary to support splitting that array if the moved item triggering the AJAX call was dropped in the middle of the unindexed items.