Updating a card without `done` clears its done state

オープン 初心者向け
#8,792 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@whoalin1 がすでに取り組んでいます。

2026年11月28日 から。

  • #8824 @whoalin1 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
api, backend

調査の方向性

CardService::update() の 323〜327 行目付近から始めてください。ここでは else ブランチが done 状態をクリアしています。これを、124 行目付近の CardOcsController::update() にある OptionalNullableValue のチェック、およびその箇所の else ブランチと比較してください。変更する前に、コミット cf4d6268a と issue #534 を読み、else ブランチが存在する理由を確認してください。done を含まない PUT では카ードの done 状態が維持され、明示的な "done": null では引き続き done 状態がクリアされ、既存のカード更新テストがすべて通ることが完了条件です。

索引モデルが issue の本文から書いたものです。

説明

0. Needs triage bug

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

  1. Mark a card as done.
  2. Call PUT /ocs/v2.php/apps/deck/api/v1.0/cards/{cardId} with a new title and the other required fields, without done.
  3. The card's done is now null.

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

環境構築

Codespaces で開く

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

はじめの一歩

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

nextcloud/deck のほかの issue

nextcloud/deck の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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