dify/api/controllers/console/app
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
..
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2024-04-08 18:51:46 +08:00
advanced_prompt_template.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
agent.py refactor: port reqparse to Pydantic model (#28949) 2025-12-05 13:05:53 +09:00
annotation.py refactor: port api/controllers/console/app/annotation.py api/controllers/console/explore/trial.py api/controllers/console/workspace/account.py api/controllers/console/workspace/members.py api/controllers/service_api/app/annotation.py to basemodel (#31833) 2026-02-03 09:59:00 +08:00
app_asset.py fix(app-assets): restore atomic batch upload for nested folder targets 2026-03-26 15:16:55 +08:00
app_import.py feat(bundle): manifest-driven import with sandbox upload 2026-01-29 22:33:31 +08:00
app.py Merge branch 'main' into feat/support-agent-sandbox 2026-03-24 17:12:13 +08:00
audio.py refactor(api): move model_runtime into dify_graph (#32858) 2026-03-02 20:15:32 +08:00
completion.py refactor(api): move model_runtime into dify_graph (#32858) 2026-03-02 20:15:32 +08:00
conversation_variables.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
conversation.py refactor: select in remaining console app controllers (#33969) 2026-03-24 02:53:05 +09:00
error.py Merge branch 'feat/collaboration2' into feat/support-agent-sandbox 2026-01-25 00:00:03 +08:00
generator.py Merge branch 'main' into sandboxed-agent-rebase 2026-03-24 11:19:50 +08:00
mcp_server.py refactor: select in remaining console app controllers (#33969) 2026-03-24 02:53:05 +09:00
message.py Merge branch 'main' into sandboxed-agent-rebase 2026-03-24 11:19:50 +08:00
model_config.py refactor: select in remaining console app controllers (#33969) 2026-03-24 02:53:05 +09:00
ops_trace.py refactor: port reqparse to Pydantic model (#28949) 2025-12-05 13:05:53 +09:00
site.py refactor: select in remaining console app controllers (#33969) 2026-03-24 02:53:05 +09:00
skills.py feat: update LLM node skills API to extract tool dependencies and change endpoint to POST 2026-03-11 14:41:33 +08:00
statistic.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
workflow_app_log.py refactor: move workflow package to dify_graph (#32844) 2026-03-02 18:42:30 +08:00
workflow_comment.py chore: use AccountWithRole instead of account_with_role_fields 2026-02-04 14:11:32 +08:00
workflow_draft_variable.py Merge main HEAD (segment 5) into sandboxed-agent-rebase 2026-03-23 14:20:06 +08:00
workflow_run.py refactor: move workflow package to dify_graph (#32844) 2026-03-02 18:42:30 +08:00
workflow_statistic.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
workflow_trigger.py fix: doc not gen bug (#31547) 2026-01-27 20:19:39 +09:00
workflow.py Merge main HEAD (segment 5) into sandboxed-agent-rebase 2026-03-23 14:20:06 +08:00
wraps.py refactor: select in remaining console app controllers (#33969) 2026-03-24 02:53:05 +09:00