Repository navigation
fix(taskprocessing): handle deleted users in checkGuestAccess - #67670
Open
kukanggg89 wants to merge 1 commit into
Open
kukanggg89 wants to merge 1 commit into
kukanggg89 wants to merge 1 commit into
Conversation
IUserManager::get() returns null for a deleted user id, and checkGuestAccess() passed that null straight into getBackend(), ending in `Call to a member function getBackend() on null` whenever a task of a deleted account was processed or rescheduled. Return false for a missing user instead, so scheduling and running such a task fails with a plain PreConditionNotMetException and getAvailableTaskTypes() returns an empty list. Covered by two tests: no task types are listed for a deleted user id, and scheduling a task for one throws. Fixes nextcloud#67535 Signed-off-by: parel <farelalfarizi89@gmail.com> Assisted-by: Muse:Muse Spark 1.3
kukanggg89
requested review from
julien-nc,
kyteinsky and
marcelklehr
as code owners
December 4, 2026 04:38
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #67535
Summary
Manager::checkGuestAccess()resolved the user withIUserManager::get()and calledgetBackend()on the result without checking it. For a deleted user id that returns null, so processing or rescheduling a task of a deleted account ended inCall to a member function getBackend() on nullwhen the guests app was installed andai.taskprocessing_guestswas off.This adds an explicit null check: a missing user now gets no guest access.
getAvailableTaskTypes()returns an empty list for that user id, and scheduling or running one of their tasks throws the existingPreConditionNotMetExceptioninstead of anError.Two tests in
tests/lib/TaskProcessing/TaskProcessingTest.phpcover it: no task types are listed for a deleted user id, and scheduling a task for one throws with the guest-access message.I did not run the tests locally, there is no PHP toolchain in this environment, so the repo CI has to confirm they pass. The guests app is not installed in the server unit test environment, so the tests assert the fixed behavior (empty list, clean exception) rather than reproducing the original fatal error with the guests backend loaded.
TODO
Checklist
1. to review,featurecomponent) (n/a: set by maintainers)stable32) (n/a: set by maintainers)AI (if applicable)
Drafted with help from Claude. I reviewed and revised every change myself before opening this PR.