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

Đang mở Phù hợp với người mới
#8,791 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@AlirezaAghaee1996 đang làm issue này rồi.

Từ ngày 28/11/2026.

  • #8823 của @AlirezaAghaee1996 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
api, backend

Hướng nghiên cứu

Lỗi crash nằm trong ExternalBoardService::updateCardOnRemote() tại lib/Service/ExternalBoardService.php, nơi $done bị dereference khoảng dòng 175 mà không kiểm tra null. Hãy đọc phương thức đó và các tham số mà nó chuyển tiếp tới DeckFederationProxy::put(), sau đó thêm unit test cho các lời gọi không có done, có giá trị, và có null tường minh. Hoàn thành khi một cập nhật không có done được chuyển tiếp tới chủ sở hữu mà không có khóa done và trả về 200 thay vì 500.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
JavaScript
Star
1.4k
Fork
380
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
72

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nextcloud/deck

Tất cả issue của nextcloud/deck

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.