Commit graph

163 commits

Author SHA1 Message Date
Julien Veyssier
76709d7efc
feat(task-streaming): address review comments
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 15:38:10 +02:00
Julien Veyssier
3f4eae2d0b feat(task-streaming): only send notify_push status updates after we actually apply the change in the db
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
Julien Veyssier
c7d8369b5f feat(task-streaming): adjust notify push messages, add sort of a namespace
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
Julien Veyssier
4da89e92dd feat(task-streaming): send a notify_push message whenever a task status changes
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
Julien Veyssier
8ee02812ef feat(task-streaming): rename ISynchronousOptionsProvider to ISynchronousOptionsAwareProvider
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
Julien Veyssier
b04de05805 fix(task-streaming): fix psalm issues, run cs:fix, gen openapi specs
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
Julien Veyssier
207f347afc feat(task-streaming): add new provider interface
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
Julien Veyssier
ddf914231b feat(task-streaming): add preferStreaming boolean attribute to taskprocessing tasks. pass it to ISynchronousProgressiveProvider::process
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
Julien Veyssier
a6e6d92103 feat(task-streaming): do not update the task in DB when setting intermediate result if notify_push is available
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
Julien Veyssier
d65252b8af fix(task-streaming): make the notify_push message shorter
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
Julien Veyssier
e4bea82c86 feat(task-streaming): add an endpoint to set a task intermediate output
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
Julien Veyssier
74d078e6e4 fix(task-streaming): and test sending data via notify_push
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
Julien Veyssier
7870537d01 feat(task-streaming): allow the Php providers to set intermediate results with a callback in process
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-06-10 14:52:56 +02:00
El Mehdi Abenhazou
e8c101fac8 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-04 10:49:23 +02:00
XananasX7
d0cce3da70 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-04 10:34:12 +02:00
Côme Chilliet
0d90f4272a
chore: Remove types from const properties
Support was added in PHP 8.3 and we need to support 8.2

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-06-02 09:46:16 +02:00
Côme Chilliet
b44f6a2957
fix: Remove static vars in TaskProcessing, TextProcessing, TextToImage
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-06-02 09:46:16 +02:00
Côme Chilliet
1ab09ec753
chore: Apply new coding standard to all files
The diff can be checked using: git diff --ignore-all-space --ignore-blank-lines
To see only the changes not related to blank lines.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-06-01 13:46:39 +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