Federated board stacks return 500: getReadMark() called with null user in CardService::enrichCards()
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
クラッシュは lib/Service/CardService.php の CardService::enrichCards() で発生します。カードにコメントがあると、ユーザーが null の状態で getReadMark() が呼び出されます。Nextcloud コアの Comments Manager にある getReadMark() のシグネチャを読み、その後、フェデレーションリクエスト向けに stacks エンドポイントがユーザーをどこで構築しているかを調べてください。ログイン済みユーザーのないリクエストが TypeError なしでスタックを返し、未読コメント数が 0 として扱われるか、スキップされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- JavaScript
- スター
- 1.4k
- フォーク
- 363
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 116
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nextcloud/deck のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
DeckProvider::setSubjects() overwrites IEvent subject with translated sentence → InvalidValueException, Deck bell notifications silently dropped対応中かも @tcarrondo が 11 日前に担当しました。 オープン0. Needs triage bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
nextcloud/deck#8591 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
CSV export leaves trailing commas in tags and assigned-user fields対応中かも @Kumar-s75 が 61 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
nextcloud/deck#8361 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Board clone API failure is treated as a successful board response対応中かも @Kumar-s75 が 61 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
status: ready
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
melodic-software/claude-code-plugins#15008 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
S-Needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
ACK_WAITING HELP_WANTED UPDATE_CS
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
OWASP/CheatSheetSeries#2935 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
docs-external-links-failure
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ComposioHQ/composio#5297 ·
メンテナーはふだん 1 日以内に返信