dify/api/controllers/console
yyh 12ca422c8a
fix(app-assets): restore atomic batch upload for nested folder targets
The previous nested folder upload flow bypassed the backend batch-upload
contract when parentId was set. Instead of creating the whole metadata
tree in one backend operation, the frontend recursively called
createFolder/getFileUploadUrl for each node.

That introduced two regressions for uploads into subfolders:

- consistency regression: mid-sequence failures could leave partially
  created folder trees under the destination folder
- performance regression: metadata creation degraded from a single
  batch request to O(files + folders) round-trips before file bytes
  were uploaded

This change moves nested uploads back to the original batch semantics:

- add optional parent_id support to app asset batch-upload payload
- create the whole nested tree under the target parent in
  AppAssetService.batch_create_from_tree
- pass parentId through useBatchUpload instead of using per-node
  createFolder/getFileUploadUrl calls
- remove the now-unnecessary useBatchUploadOperation wrapper
- add a backend unit test covering batch tree creation under an
  existing parent folder

After this change, both root uploads and subfolder uploads use the same
single-request metadata creation path, preserving atomic tree creation
semantics and avoiding avoidable metadata round-trips.
2026-03-26 15:16:55 +08:00
..
app fix(app-assets): restore atomic batch upload for nested folder targets 2026-03-26 15:16:55 +08:00
auth refactor: use sessionmaker().begin() in console auth controllers (#33966) 2026-03-24 23:59:21 +09:00
billing refactor: part of remove all reqparser (#29847) 2025-12-25 19:57:07 +08:00
datasets refactor: select in console datasets document controller (#34029) 2026-03-25 12:47:25 +09:00
explore refactor: select in console explore and workspace controllers (#33842) 2026-03-21 20:06:17 +09:00
socketio style: apply Ruff auto-fixes from pre-commit hook 2026-03-24 10:55:27 +08:00
tag fix(api): return proper HTTP 204 status code in DELETE endpoints (#32012) 2026-02-06 15:32:52 +08:00
workspace Merge main HEAD (segment 5) into sandboxed-agent-rebase 2026-03-23 14:20:06 +08:00
__init__.py Merge commit 'fb41b215' into sandboxed-agent-rebase 2026-03-23 10:52:06 +08:00
admin.py feat: notification (#32192) 2026-03-11 18:29:53 +08:00
apikey.py refactor: use EnumText for ApiToken.type (#33961) 2026-03-24 02:46:06 +09:00
error.py Restructure the File errors in controller (#23801) 2025-08-13 17:06:07 +08:00
extension.py refactor: split changes for api/controllers/console/extension.py (#29888) 2025-12-24 09:41:42 +08:00
feature.py fix: revert "refactor: api/controllers/console/feature.py (test)" (#31850) 2026-02-03 12:26:47 +08:00
files.py refactor: port api/fields/file_fields.py (#30638) 2026-01-06 22:55:58 +08:00
human_input_form.py feat: Human Input Node (#32060) 2026-02-09 14:57:23 +08:00
init_validate.py refactor: init_validate.py to v3 (#31457) 2026-01-30 22:39:02 +09:00
notification.py feat: notification (#32192) 2026-03-11 18:29:53 +08:00
ping.py feat: init fastopenapi (#30453) 2026-01-23 21:07:52 +09:00
remote_files.py refactor: move workflow package to dify_graph (#32844) 2026-03-02 18:42:30 +08:00
sandbox_files.py refactor: use jsonable_encoder for consistent JSON response formatting in SandboxFilesApi 2026-02-03 18:32:49 +08:00
setup.py refactor: select in console auth, setup and apikey (#33790) 2026-03-21 11:29:29 +09:00
spec.py refactor(router): apply ns.route style (#26339) 2025-09-28 13:37:06 +08:00
version.py refactor: api/controllers/console/version.py to v3 (#31463) 2026-01-26 15:04:25 +08:00
wraps.py refactor: select in console auth, setup and apikey (#33790) 2026-03-21 11:29:29 +09:00