dify/api/tests/unit_tests
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
..
commands feat: add metrics to clean message and workflow-run task (#33143) 2026-03-17 13:55:28 +08:00
configs refactor: Unify NodeConfigDict.data and BaseNodeData (#32780) 2026-03-11 23:43:58 +08:00
controllers Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-03-25 11:50:33 +08:00
core [autofix.ci] apply automated fixes 2026-03-25 05:20:02 +00:00
dify_graph fix(api): add trigger_info to WorkflowNodeExecutionMetadataKey (#33753) 2026-03-19 17:56:49 +08:00
extensions Merge commit 'fb41b215' into sandboxed-agent-rebase 2026-03-23 10:52:06 +08:00
factories refactor: move workflow package to dify_graph (#32844) 2026-03-02 18:42:30 +08:00
fields refactor: port api/fields/file_fields.py (#30638) 2026-01-06 22:55:58 +08:00
libs Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-03-25 16:07:02 +08:00
models test: replace indexing_technique string literals with IndexTechnique (#34042) 2026-03-25 12:39:58 +09:00
oss test(api): add autospec to MagicMock-based patch usage (#32752) 2026-03-01 04:30:45 +08:00
repositories Merge branch 'main' into sandboxed-agent-rebase 2026-03-24 11:19:50 +08:00
services fix(app-assets): restore atomic batch upload for nested folder targets 2026-03-26 15:16:55 +08:00
tasks test: replace indexing_technique string literals with IndexTechnique (#34042) 2026-03-25 12:39:58 +09:00
tools test: Unit test cases for core.tools module (#32447) 2026-03-12 11:48:13 +08:00
utils Merge commit '92bde350' into sandboxed-agent-rebase 2026-03-23 09:39:49 +08:00
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2024-04-08 18:51:46 +08:00
.gitignore Enhance Code Consistency Across Repository with .editorconfig (#19023) 2025-04-29 18:04:33 +08:00
conftest.py fix(api): fix the issue that workflow_runs.started_at is overwritten while resuming (#32851) 2026-03-06 15:41:30 +08:00