dify/api/controllers
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
..
cli_api style: auto-format after segment 3 import migrations 2026-03-23 10:37:02 +08:00
common refactor: move workflow package to dify_graph (#32844) 2026-03-02 18:42:30 +08:00
console fix(app-assets): restore atomic batch upload for nested folder targets 2026-03-26 15:16:55 +08:00
files Merge commit 'fb41b215' into sandboxed-agent-rebase 2026-03-23 10:52:06 +08:00
inner_api Merge main HEAD (segment 5) into sandboxed-agent-rebase 2026-03-23 14:20:06 +08:00
mcp refactor: replace remaining sa.String with EnumText 2 (#33448) 2026-03-14 20:20:30 +09:00
service_api refactor: select in console datasets document controller (#34029) 2026-03-25 12:47:25 +09:00
trigger fix: clarify webhook debug endpoint behavior (#33597) 2026-03-18 14:28:33 +08:00
web refactor: migrate db.session.query to select in inner_api and web controllers (#33774) 2026-03-20 03:32:03 +09:00
__init__.py chore(api/controllers): Apply Ruff Formatter. (#7645) 2024-08-26 15:29:10 +08:00
fastopenapi.py feat: init fastopenapi (#30453) 2026-01-23 21:07:52 +09:00