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

Open Beginner friendly
#8,791 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@AlirezaAghaee1996 is already working on this.

Since Nov 28, 2026.

  • #8823 by @AlirezaAghaee1996 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
api, backend

Research direction

The crash is in ExternalBoardService::updateCardOnRemote() in lib/Service/ExternalBoardService.php, where $done is dereferenced at about line 175 without a null check. Read that method and the parameters it forwards to DeckFederationProxy::put(), then add unit tests for calls without done, with a value, and with an explicit null. Done means an update without done is forwarded to the owner with no done key and returns 200 instead of 500.

Written by the indexing model from the issue text.

Description

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.

Dominant language
JavaScript
Stars
1.4k
Forks
380
Avg merge
1d 17h
Merged PRs (30d)
72

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextcloud/deck

All issues in nextcloud/deck

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.