Updating a card without `done` clears its done state
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
CardService::update() の 323〜327 行目付近から始めてください。ここでは else ブランチが done 状態をクリアしています。これを、124 行目付近の CardOcsController::update() にある OptionalNullableValue のチェック、およびその箇所の else ブランチと比較してください。変更する前に、コミット cf4d6268a と issue #534 を読み、else ブランチが存在する理由を確認してください。done を含まない PUT では카ードの done 状態が維持され、明示的な "done": null では引き続き done 状態がクリアされ、既存のカード更新テストがすべて通ることが完了条件です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
CardOcsController::update() distinguishes a missing done from an explicit null with OptionalNullableValue:
https://github.com/nextcloud/deck/blob/bf65da22e13a366c70c72391beaee00ed2152810/lib/Controller/CardOcsController.php#L124
But CardService::update() clears the done state whenever it receives no value:
https://github.com/nextcloud/deck/blob/bf65da22e13a366c70c72391beaee00ed2152810/lib/Service/CardService.php#L323-L327
So an API client that updates a card's title without sending done marks the card as not done. The web UI is not affected, because it sends the whole card.
To Reproduce
- Mark a card as done.
- Call
PUT /ocs/v2.php/apps/deck/api/v1.0/cards/{cardId}with a new title and the other required fields, withoutdone. - The card's
doneis nownull.
Expected behavior
A missing done leaves the done state unchanged; an explicit "done": null clears it.
Suggested fix
Not tested; a direction based on the code and its history.
Drop the else branch in CardService::update():
if ($done !== null) {
$card->setDone($done->getValue());
}
The else branch was added in cf4d6268a (January 2024, for #534) so that REST clients could mark a card as undone in a normal update. Since then all three controllers (CardController, CardApiController and CardOcsController) wrap an explicit null in OptionalNullableValue, so "done": null still clears the state without the else branch. It would be good to confirm this against the use case in #534 before changing it.
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
Reproduced on instance B; the code paths are unchanged on main (bf65da22e).
This report was drafted with AI assistance (Claude Code) and reproduced on the instance 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 on an incoming federated board without `done` returns 500対応中かも @AlirezaAghaee1996 が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/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 日以内に返信