TaskProcessing checkGuestAccess() fails with an Error for a deleted user id

オープン 初心者向け
#67,535 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
backend, testing

調査の方向性

lib/private/TaskProcessing/Manager.php の checkGuestAccess() 周辺を読み、tests/lib/TaskProcessing/TaskProcessingTest.php にある既存のテストを確認してください。issue に記載された古いユーザー ID のケースを再現し、ユーザーが見つからない場合のテストを追加してください。ユーザーが null の場合に検索が例外を投げず、テストが通れば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug feature: TaskProcessing good first issue
Bug description

Manager::checkGuestAccess() resolves the user with IUserManager::get() but does not handle null:

https://github.com/nextcloud/server/blob/3a68340a6c806a18cdd0d9667a3b9ec5f096b135/lib/private/TaskProcessing/Manager.php#L1063-L1078

If the user id no longer exists (e.g. a task of a deleted account that is processed or rescheduled, or getAvailableTaskTypes() called with a stale user id), the guests app is installed and ai.taskprocessing_guests is not 'true', this ends in Call to a member function getBackend() on null instead of a clean result.

Steps to reproduce

Found by code reading.

  1. Install the guests app, keep ai.taskprocessing_guests at its default.
  2. Schedule a task for a user, delete the user before the task is processed.
  3. Processing / looking up the task's type calls checkGuestAccess($task->getUserId()) and throws an Error.
Expected behavior

A missing user is handled explicitly (e.g. $user === null → no guest access check / deny), covered by a test in tests/lib/TaskProcessing/TaskProcessingTest.php.

Nextcloud version

master

主要言語
PHP
スター
37.6k
フォーク
5.4k
平均マージ
1日 20時間
マージ済み PR(30日)
605

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextcloud/server のほかの issue

nextcloud/server の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。