Updating a card on an incoming federated board without `done` returns 500

未关闭 适合新手
#8,791 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@AlirezaAghaee1996 已经在做这个了。

开始于 2026年11月28日。

  • #8823 来自 @AlirezaAghaee1996 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
php
领域
api, backend

调研方向

崩溃位于 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

  1. Share a board from instance B with a user on instance A.
  2. As that user on instance A, call PUT /ocs/v2.php/apps/deck/api/v1.0/cards/{cardId} with id, boardId (the local board id), stackId, title, type, order, description, duedate and deletedAt, but without done.
  3. 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

环境准备

在 Codespaces 中打开

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

从这里开始

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

nextcloud/deck 的其他 Issue

查看 nextcloud/deck 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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