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

オープン 初心者向け
#8,791 コメント 0 件 リアクション 0 件 担当者 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行目で null チェックなしに $done を参照しています。そのメソッドと、DeckFederationProxy::put() に渡しているパラメータを読んでから、done を渡さない呼び出し、値を渡す呼び出し、明示的な null を渡す呼び出しのユニットテストを追加してください。done を含まない更新がキー done なしでオーナーに転送され、500 ではなく 200 を返せば完了です。

索引モデルが 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時間
マージ済み PR(30日)
72

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextcloud/deck のほかの issue

nextcloud/deck の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。