Dropping a list (stack) does not persist: PUT stacks/{id}/reorder is sent with order: null (400)

未关闭
#8,720 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript
领域
frontend

调研方向

Start in src/components/board/Board.vue at onDropStack, then trace how src/stores/stack.js orderStack passes addedIndex to the reorder request. Reproduce a list drag and investigate why the index is null and whether the card drop handler also receives the event. Done when dropping a list sends a valid order, the order survives reload, and no unintended card reorder request is sent.

由索引模型根据 Issue 内容生成。

描述

1. to develop bug

Describe the bug

Dropping a list (stack) at a new position on a board does not persist. The list moves on screen, but a reload puts it back where it was.

In the browser network log, the drop sends

PUT /ocs/v2.php/apps/deck/api/v1.0/stacks/16/reorder with body {"order":null,"boardId":5}

and the server answers 400 with an empty body. Just before it, a second request is sent:

PUT /ocs/v2.php/apps/deck/api/v1.0/cards/undefined/reorder with body {"stackId":13,"order":0,"boardId":5}

which is answered 403 (Permission denied).

To Reproduce

  1. As the board owner (all permissions), open a board with four lists: Priorities, To Do, In Progress, Completed.
  2. Drag the "Completed" list by its header to the left of the other lists and drop it.
  3. The list moves on screen. Reload the page: it is back in its original place.

Expected behavior

The new list order is saved.

Additional information

  • The server accepts a valid request. PUT .../stacks/16/reorder with {"order":1} returned 200 and the new position was saved. So the problem is the value the web UI sends, not the server or permissions.
  • Reading the code (current main): src/components/board/Board.vue calls orderStack({ stack, removedIndex, addedIndex }) from onDropStack, and src/stores/stack.js orderStack() passes addedIndex straight to apiClient.reorderStack(stack.id, addedIndex, stack.boardId) without checking it. In my capture addedIndex arrived as null. I have not worked out why it is null.
  • The cards/undefined/reorder request suggests a card drop handler also receives the same drop event (possibly nested drag containers). I have not verified this.
  • It still happens when each list has its own distinct order value (0, 1, 2, 3). It first showed up on boards whose lists all had order: 0, but I captured the null request after assigning distinct values, so that is not the cause.
  • Caveat on reproduction: the request above was captured from a drag performed with browser automation (synthetic mouse events). A manual drag by a person shows the same visible symptom (the list reverts after reload), but I have not captured the request from a manual drag.

Client details:

  • OS: Windows 10
  • Browser: Chrome (desktop)
  • Version: current stable
Server details

Operating system: Linux (Docker container on a Synology NAS)

Web server: Apache (official nextcloud:35-apache image), behind a reverse proxy

Database: MariaDB 11.4

PHP version: 8.5.12

Nextcloud version: 35.0.2

Deck version: 1.19.2 (from the app store)

Where did you install Nextcloud from: Official Docker image

Are you using an external user-backend, if yes which one: No

Logs
Nextcloud log

No Deck entries were logged when the drop failed.

Browser log (network)
PUT /ocs/v2.php/apps/deck/api/v1.0/cards/undefined/reorder
    {"stackId":13,"order":0,"boardId":5}                -> 403 Permission denied
PUT /ocs/v2.php/apps/deck/api/v1.0/stacks/16/reorder
    {"order":null,"boardId":5}                          -> 400 (empty body)
主要语言
JavaScript
星标
1.4k
派生
380
平均合并
1 天 17 小时
30 天内合并 PR
72

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nextcloud/deck 的其他 Issue

查看 nextcloud/deck 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。