Andy Scherzinger
495f3082a0
Merge pull request #60983 from nextcloud/backport/60884/stable34
...
[stable34] fix(TaskProcessing): restrict allowed_classes in Manager cache deserialization
2026-06-17 23:00:01 +02:00
El Mehdi Abenhazou
d878ec67fa
fix(TaskProcessing): restrict allowed_classes in Manager cache deserialization
...
The availableTaskTypes cache stores serialized arrays containing
ShapeDescriptor objects, ShapeEnumValue objects, and EShapeType enum
values. The unserialize() call did not restrict which classes could
be instantiated.
Restrict deserialization to the three known types:
- OCP\TaskProcessing\ShapeDescriptor
- OCP\TaskProcessing\ShapeEnumValue
- OCP\TaskProcessing\EShapeType
This prevents PHP Object Injection if an attacker gains write access
to the distributed cache backend.
Signed-off-by: El Mehdi Abenhazou <mehdiananas007@gmail.com>
2026-06-17 19:11:28 +02:00
XananasX7
52d371cb70
fix(TaskProcessing): add allowed_classes to unserialize() in Manager cache
...
The availableTaskTypes cache stores serialized arrays containing
ShapeDescriptor objects, ShapeEnumValue objects, and EShapeType enum
values. The unserialize() call did not restrict which classes could
be instantiated.
Restrict deserialization to the three known types:
- OCP\TaskProcessing\ShapeDescriptor
- OCP\TaskProcessing\ShapeEnumValue
- OCP\TaskProcessing\EShapeType
This prevents PHP Object Injection if an attacker gains write access
to the distributed cache backend (e.g., a Redis instance without
authentication or with weak ACLs), which is a known real-world attack
vector in shared hosting and container environments.
2026-06-17 19:11:28 +02:00
copilot-swe-agent[bot]
86b4dc6ae1
fix(taskprocessing): correct Task::COLUMNS to Task::$columns in claimWithSkipLocked
2026-06-17 19:00:53 +02:00
Yoan Bozhilov
d10fe955a7
docs(taskprocessing): document lockTask semantic change
...
Per review feedback: note in the lockTask docblock that the guard changed from
`status != RUNNING` to `status = SCHEDULED`, and that callers must now treat a
0 return as "the task is no longer claimable" rather than assuming success.
Signed-off-by: Yoan Bozhilov <bygadd@gmail.com>
Assisted-by: Claude Code:claude-opus-4-8
2026-06-17 19:00:53 +02:00
Yoan Bozhilov
3f3f9c6464
fix(taskprocessing): guard lockTask on scheduled, record started_at, Oracle fallback
...
Address review feedback (@marcelklehr, Copilot):
- lockTask claims only SCHEDULED tasks (was status != RUNNING) and stamps
started_at in the same atomic UPDATE, so a finished task cannot be re-claimed
and the external-provider claim path records started_at as well.
- claimWithBoundedRetry re-reads after lockTask instead of a follow-up UPDATE.
- Oracle joins SQLite on the bounded-retry fallback: Oracle cannot combine a
row-limiting clause with FOR UPDATE (ORA-02014), which failed the claim tests
on Oracle CI.
- Reword the worker docblock/comments to "prefer oldest available" (parallel
SKIP LOCKED does not guarantee a strict global order).
- Add a regression test that lockTask does not resurrect a finished task.
Signed-off-by: Yoan Bozhilov <bygadd@gmail.com>
Assisted-by: Claude Code:claude-opus-4-8
2026-06-17 19:00:53 +02:00
Marcel Klehr
440d8e7a27
fix: Address review comments
...
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2026-06-17 19:00:53 +02:00
Yoan Bozhilov
aa5f45cecd
fix(taskprocessing): claim tasks atomically with SKIP LOCKED + composite index
...
Replace the worker retry/ignore-list claim-loop with a single atomic
SELECT ... FOR UPDATE SKIP LOCKED claim (SQLite bounded-retry fallback),
preserving the no-duplicate guarantee while removing the thundering-herd
contention that throttled backlog draining. Add a (status,type,last_updated)
index via the table-creating migration + db:add-missing-indices listener.
Signed-off-by: Yoan Bozhilov <bygadd@gmail.com>
Assisted-by: Claude Code:claude-opus-4-8
2026-06-17 19:00:53 +02:00
Côme Chilliet
9680004b58
chore: Remove almost all uses of deprecated IServerContainer in lib/private
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-05-11 16:22:22 +02:00
Lukas Schaefer
574243fab3
feat(TaskProcessing): add TextToTextReformatParagraphs task type
...
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
2026-05-06 09:03:07 -04:00
Ferdinand Thiessen
e0ba4d71b6
chore: add missing Override attribute to OC
...
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-04-28 21:29:27 +02:00
Oleksander Piskun
f573285040
feat(taskprocessing): Add queue_stats API endpoint for external autoscalers
...
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
2026-03-30 12:03:19 +00:00
provokateurin
f12cecb684
feat(rector): Enable SafeDeclareStrictTypesRector
...
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-09 10:59:31 +01:00
Carl Schwan
c96ece0bcb
refactor: Add more typing
...
- repairs job
- database
- redis
And remove Helpertest which was unused outside of some tests.
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:55:39 +01:00
Carl Schwan
7b6078875b
refactor: Run rector on lib/private
...
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:50:18 +01:00
Marcel Klehr
c13d95809a
Fix: Run cs:fix
2026-02-04 13:26:29 +01:00
Marcel Klehr
c48a09f27d
fix(TaskProcessing): Refactor TextToImage fallback
...
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2026-02-04 13:26:29 +01:00
Marcel Klehr
25044f82ae
fix(TaskProcessing): Adjust OCR task type to allow for multiple files and pdfs
...
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-12-09 09:21:33 +01:00
Julien Veyssier
b4f7fe2cb6
feat(taskprocessing): add a boolean 'includeWatermark' to taskprocessing tasks and pass it to ISynchronousWatermarkingProvider::process
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-11-27 11:32:08 +01:00
Marcel Klehr
d04d575ed3
Merge branch 'master' into feat/taskprocessing/user-facing-error-message
...
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-30 10:13:39 +01:00
Marcel Klehr
3ee6999682
fix: Use substr to cut error messages
...
This allows for cutting them to longer lengths
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-30 10:07:57 +01:00
Marcel Klehr
7f15598083
fix: address review comments
...
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-20 15:59:25 +02:00
Marcel Klehr
6a1501a7d6
fix: address review comments
...
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-20 15:59:25 +02:00
Marcel Klehr
044e92bf4e
feat(TaskProcessing): Introduce ITriggerableProvider
...
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
# Conflicts:
# lib/private/TaskProcessing/Db/TaskMapper.php
2025-10-20 15:59:25 +02:00
Marcel Klehr
9df303f876
fix: address review comments
...
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-20 15:54:10 +02:00
Marcel Klehr
3f527661b1
fix: Create new class instead of extending existing class
...
to make it easier to use this across nextcloud versions
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-15 11:20:00 +02:00
Marcel Klehr
7373f11af6
feat(TaskProcessing): user-facing error messages
...
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-14 16:53:41 +02:00
Marcel Klehr
be8e168f38
fix: Address psalm issues and review comments
...
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-14 15:51:31 +02:00
Marcel Klehr
16da8bbc8a
fix(TaskProcessingApiController): Implement getNextScheduledTasks for next_batch endpoint
...
in order to avoid hitting the DB with multiple 1 row requests
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-14 11:50:29 +02:00
Marcel Klehr
ea8ab8e192
Merge pull request #55646 from nextcloud/feat/taskprocessing/is-internal
...
enh(TaskProcessing): Introduce internal task types
2025-10-14 08:25:00 +02:00
Marcel Klehr
13eb2d1cbd
feat(TaskProcessing): Introduce internal task types
...
which are not shown in the assistant UI
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-13 11:07:40 +02:00
Marcel Klehr
a6f899f925
fix(TaskProcessing): Increase MAX_TASK_AGE to 6 months
...
to comply with the EU AI act
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-06 16:44:53 +02:00
Marcel Klehr
fe54914ef9
fix(TaskProcessing): Cache task types by
...
user language
fixes https://github.com/nextcloud/assistant/issues/357
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-09-17 14:16:01 +02:00
Julien Veyssier
8c447eaba6
feat(taskprocessing): add manager method to get the list of available task type IDs
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-09-05 11:37:34 +02:00
Julien Veyssier
aa2ca86fb3
feat(taskprocessing): avoid generator cascade
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-07 15:12:22 +02:00
Julien Veyssier
e2c65b2493
feat(taskprocessing): fix mistake
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-07 15:12:22 +02:00
Julien Veyssier
222b19b805
feat(taskprocessing): rename cleanup column to allow_cleanup
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-07 15:12:22 +02:00
Julien Veyssier
cc295f2452
feat(taskprocessing): use Generator::getReturn to get the list of deleted tasks in the cleanup command
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-07 15:12:21 +02:00
Julien Veyssier
19801f7ec4
feat(taskprocessing): move cleanup method to private taskprocessing manager, use it in the cleanup bg job and implement a cleanup command
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-07 15:12:21 +02:00
Julien Veyssier
8c52b6c0fe
feat(taskprocessing): add cleanup flag to tasks to decide if they should be cleaned up automatically
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-07 15:12:21 +02:00
Julien Veyssier
be7ef439cf
fix(taskprocessing): move LAZY_CONFIG_KEYS constant to the private namespace
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-04 10:11:24 +02:00
Julien Veyssier
2e3fa51132
feat(taskprocessing): load and store some config keys lazily
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-04 10:11:24 +02:00
Lukas Schaefer
4731ecf4d4
Merge branch 'master' into feat/task/analyze-image
2025-07-08 08:35:04 -04:00
Julien Veyssier
2da3f450fa
feat(TaskProcessing): add agency audio-to-audio task type
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-07-07 15:29:55 +02:00
Julien Veyssier
af059cbf61
feat(TaskProcessing): add audio-to-audio chat task type
...
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-07-07 11:39:47 +02:00
Lukas Schaefer
20a779e4aa
feat: support multiple images
...
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
2025-07-03 11:01:10 -04:00
Jana Peper
603522a59c
test: fix tests
...
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
2025-07-03 10:25:19 +02:00
Jana Peper
f8886fe27a
feat: add toggle for AI guest restriction
...
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
2025-07-03 10:25:19 +02:00
Lukas Schaefer
3e24c40939
feat(TaskProcessing): Add AnalyzeImage TaskType
...
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
2025-07-02 09:18:53 -04:00
Ferdinand Thiessen
5981b7eb51
chore: apply new CSFixer rules
...
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
# Conflicts:
# apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +02:00