Updating a card on an incoming federated board without `done` returns 500
维护者通常 1 天内回复
评估
调研方向
崩溃位于 lib/Service/ExternalBoardService.php 中的 ExternalBoardService::updateCardOnRemote(),约第 175 行处在没有空值检查的情况下解引用了 $done。请阅读该方法以及它转发给 DeckFederationProxy::put() 的参数,然后为不带 done、带有值、以及显式传入 null 的调用添加单元测试。完成标准是:不带 done 的更新被转发给所有者时不包含 done 键,并返回 200 而不是 500。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
ExternalBoardService::updateCardOnRemote() calls $done->getValue(), but $done is null when the request has no done key:
https://github.com/nextcloud/deck/blob/bf65da22e13a366c70c72391beaee00ed2152810/lib/Service/ExternalBoardService.php#L175
Updating a card on an incoming federated board through the API then fails before anything is sent to the owner.
To Reproduce
- Share a board from instance B with a user on instance A.
- As that user on instance A, call
PUT /ocs/v2.php/apps/deck/api/v1.0/cards/{cardId}withid,boardId(the local board id),stackId,title,type,order,description,duedateanddeletedAt, but withoutdone. - Response 500. Log:
Call to a member function getValue() on null in …/lib/Service/ExternalBoardService.php line 175.
Expected behavior
The update is forwarded to the owner.
Suggested fix
Only forward done when the client sent it, so the owner handles the request the same way as a local update with the same parameters:
$params = [
// … all current keys except 'done' …
];
if ($done !== null) {
$params['done'] = $done->getValue();
}
Unit tests can call updateCardOnRemote() without done, with a value and with an explicit null, and check the parameters passed to DeckFederationProxy::put(). I tested this change with unit tests and on the two instances below: the update now returns 200 and arrives at the owner.
Server details
Two instances, both Docker, MariaDB 11.8 / MySQL, PHP 8.5.13:
- Instance A: Nextcloud 35.0.3, Deck 1.19.2
- Instance B: Nextcloud 34.0.6, Deck 1.18.7
The code paths are unchanged on main (bf65da22e).
This report was drafted with AI assistance (Claude Code) and reproduced on the two instances above.
- 主要语言
- JavaScript
- 星标
- 1.4k
- 派生
- 380
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 72
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nextcloud/deck 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
2 small URL Bugs未关闭1. to develop bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
Updating a card without `done` clears its done state可能已有人在做 @whoalin1 于 5 天前认领。 未关闭0. Needs triage bug
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
Deck treats unset files_sharing server-to-server keys as disabled可能已有人在做 @whoalin1 于 5 天前认领。 未关闭0. Needs triage bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
vecture-be/belgium-data-desk#181 ·
维护者通常 1 天内回复
-
enhancement frontend reconciliation UX
难度 2/5 1-3 小时 新手友好度 82/100
humlab-sead/sead_shape_shifter#882 ·
维护者通常 1 天内回复
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
erkamyaman/rust-anything#1381 ·
维护者通常 1 天内回复
-
a11y accessibility area: i18n area: pages area: sites bug i18n priority: P2 seo tech: javascript tests
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复