Updating a card on an incoming federated board without `done` returns 500
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
クラッシュは 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
- 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時間
- マージ済み PR(30日)
- 72
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
nextcloud/deck#8834 · コメント 1 件 ·
メンテナーはふだん 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
flisk-sh/chat#833 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信