Repository navigation
Conversation
Setup::installBackgroundJobs() only registered the TextProcessing RemoveOldTasks job, so a fresh installation ran the task processing and text2image cleanups never, while the AddRemoveOldTasksBackgroundJob repair step registers all three. Register the TaskProcessing and TextToImage jobs as well so old tasks and their output files are cleaned up on every installation, not only on upgraded ones. Assisted-by: OpenCode:glm-5.3-flash Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Deleting a Nextcloud account left its task processing, text processing and text to image tasks and their generated files in place. The tasks are bound to the user id alone, so a new account created later with the same user id inherited the previous holder's tasks: their prompts and results were readable, and their output files could be downloaded. Add a UserDeletedEvent listener that deletes a user's rows from all three task tables together with the files they generated in appdata, without blocking the account deletion on failure. Assisted-by: OpenCode:glm-5.3-flash Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Member
Author
|
/backport to stable35 |
Member
Author
|
/backport to stable34 |
Member
Author
|
/backport to stable33 |
marcelklehr
approved these changes
Nov 27, 2026
Member
|
Do we also delete tasks by users that were deleted before these changes are released, or do we rely on the OldTaskRemovalJobs only? |
Member
Author
|
@marcelklehr We rely on the old jobs. So rows with allow_cleanup = 0 are never removed by the aging job, so the leftovers of such tasks and their output files can persist indefinitely, even after this change. We could fix that with repair step that delete the rows linked to a non-existing user. Wdyt? |
Member
If the goal is to have no entries in the tasks table that belong to non-existent users, let's go with the repair step :) |
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.
Summary
Deleting a Nextcloud account left its task processing, text processing and text to image tasks and their generated files in place. The tasks are bound to the user id alone, so a new account created later with the same user id inherited the previous holder's tasks: their prompts and results were readable, and their output files could be downloaded.
A
UserDeletedEventlistener now deletes a user's rows from all three task tables together with the files they generated in appdata. Each cleanup step catches its own errors so a failure never blocks the account deletion.While investigating this,
Setup::installBackgroundJobs()turned out to only register the text processing cleanup job. Fresh installations therefore never ran the task processing and text to image cleanups; both jobs are now registered as well, matching what the repair step does on upgraded instances.Testing
A new regression test covers finished, exempt and still scheduled tasks of a deleted user, their output files, and the legacy text processing and text to image rows, and asserts that another user's tasks survive. The task processing test suite passes (65 tests, 341 assertions) and the setup tests pass (19 tests), both tested on sqlite locally.
Assisted by OpenCode:glm-5.3-flash
Checklist
3. to review, feature component)stable32)AI (if applicable)