Federated board stacks return 500: getReadMark() called with null user in CardService::enrichCards()
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đá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
- 72/100
Hướng nghiên cứu
Lỗi xảy ra trong CardService::enrichCards() ở lib/Service/CardService.php, nơi getReadMark() được gọi với người dùng null khi một thẻ có bình luận. Hãy đọc chữ ký của getReadMark() trong Comments Manager của lõi Nextcloud, sau đó tìm xem endpoint stacks tạo người dùng cho các yêu cầu liên hợp ở đâu. Hoàn thành khi một yêu cầu không có người dùng đăng nhập trả về stack mà không có TypeError, và số bình luận chưa đọc được xử lý là 0 hoặc bỏ qua.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Describe the bug
When a board is shared through Deck federation, the remote server's request for the board's stacks fails with HTTP 500 on the owning server whenever a card in the stack has comments. The owning server logs:
OC\Comments\Manager::getReadMark(): Argument #3 ($user) must be of type OCP\IUser, null given,
called in custom_apps/deck/lib/Service/CardService.php on line 88
The federated request (user agent Nextcloud-Server-Crawler/34.0.5) has no logged-in user, so $user is null. CardService::enrichCards() passes it straight to getReadMark() whenever $countComments > 0. The same line is unchanged on main.
On the remote server this surfaces as DeckFederationProxy exceptions (Server error: GET .../ocs/v2.php/apps/deck/api/v1.0/stacks/<id> resulted in a 500), and the federated board does not load for its users.
To Reproduce
- On server A, create a board with a stack containing a card that has at least one comment.
- Share the board with a user on server B via federation.
- As the user on server B, open the federated board.
- Server B logs a 500 from
GET /ocs/v2.php/apps/deck/api/v1.0/stacks/<id>on server A; server A logs thegetReadMark()TypeError above.
Expected behavior
Stacks load for federated users. Unread-comment counts could be skipped (or treated as 0) when there is no local user.
Suggested fix
In CardService::enrichCards(), only call getReadMark() when $user !== null:
$lastRead = ($countComments > 0 && $user !== null)
? $this->commentsManager->getReadMark('deckCard', (string)$card->getId(), $user)
: null;
Server details
- Nextcloud: 34.0.5 (official Docker image)
- Deck: 1.18.5 on the owning server, 1.18.6 on the remote servers
- Database: MariaDB 10.11
- PHP: as shipped in
nextcloud:34.0.5
Log entry on the owning server (trimmed):
"app":"deck","method":"GET","url":"/ocs/v2.php/apps/deck/api/v1.0/stacks/14",
"userAgent":"Nextcloud-Server-Crawler/34.0.5","version":"34.0.5.1",
"Exception":"Exception","Message":"OC\\Comments\\Manager::getReadMark(): Argument #3 ($user) must be of type OCP\\IUser, null given, called in /var/www/html/custom_apps/deck/lib/Service/CardService.php on line 88 in file '/var/www/html/lib/private/Comments/Manager.php' line 1437"
29 occurrences on the owning server in the last week.
- Ngôn ngữ chính
- JavaScript
- Star
- 1.4k
- Fork
- 363
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 116
Chuẩn bị môi trường
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.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nextcloud/deck
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
DeckProvider::setSubjects() overwrites IEvent subject with translated sentence → InvalidValueException, Deck bell notifications silently droppedCó thể đã có người làm @tcarrondo đã nhận 11 ngày trước. Đang mở0. Needs triage bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
nextcloud/deck#8591 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
CSV export leaves trailing commas in tags and assigned-user fieldsCó thể đã có người làm @Kumar-s75 đã nhận 61 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
nextcloud/deck#8361 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Board clone API failure is treated as a successful board responseCó thể đã có người làm @Kumar-s75 đã nhận 61 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nextcloud/deck
Issue tương tự
-
status: ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
melodic-software/claude-code-plugins#15008 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
S-Needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
ACK_WAITING HELP_WANTED UPDATE_CS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
OWASP/CheatSheetSeries#2935 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs-external-links-failure
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
ComposioHQ/composio#5297 ·
Maintainer thường phản hồi trong vòng 1 ngày