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

Offen Anfängerfreundlich
#8,791 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@AlirezaAghaee1996 arbeitet bereits daran.

Seit 28.11.2026.

  • #8823 von @AlirezaAghaee1996 — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
78/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
php
Bereich
api, backend

Rechercherichtung

Der Absturz liegt in ExternalBoardService::updateCardOnRemote() in lib/Service/ExternalBoardService.php, wo $done etwa in Zeile 175 ohne Null-Prüfung dereferenziert wird. Lies diese Methode und die Parameter, die sie an DeckFederationProxy::put() weitergibt, und füge dann Unit-Tests für Aufrufe ohne done, mit einem Wert und mit einem explizit übergebenen null hinzu. Fertig ist, wenn ein Update ohne done an den Eigentümer weitergeleitet wird, ohne den Schlüssel done, und statt 500 eine 200 zurückgibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
JavaScript
Sterne
1.4k
Forks
380
Ø Merge
1 T. 17 Std.
Gemergte PRs (30 T.)
72

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nextcloud/deck

Alle Issues in nextcloud/deck

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.