dify/web/app/components/workflow/skill/hooks
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
..
file-tree fix(app-assets): restore atomic batch upload for nested folder targets 2026-03-26 15:16:55 +08:00
sqlite refactor: extract sqlite constants 2026-01-22 16:15:58 +08:00
skill-save-context.ts refactor: extract skill save context, stabilize mutation dependency, and deduplicate cache updates 2026-02-03 21:09:35 +08:00
use-fetch-text-content.ts refactor(web): use skipToken for optional query inputs 2026-02-25 00:56:38 +08:00
use-file-node-view-state.spec.tsx refactor(skill)!: add file node view-state flow and mode-based file data hook 2026-02-06 15:39:00 +08:00
use-file-node-view-state.ts refactor(skill)!: add file node view-state flow and mode-based file data hook 2026-02-06 15:39:00 +08:00
use-file-type-info.ts feat(web): add inline PDF preview support for skill file viewer 2026-02-05 17:21:01 +08:00
use-skill-auto-save.spec.tsx refactor(skill): regroup skill body, file tree, and tree hooks 2026-02-07 14:20:01 +08:00
use-skill-auto-save.ts refactor: extract skill save context, stabilize mutation dependency, and deduplicate cache updates 2026-02-03 21:09:35 +08:00
use-skill-file-data.spec.tsx refactor(web): replace query hooks with queryOptions factories (#32520) 2026-02-25 00:31:25 +08:00
use-skill-file-data.ts refactor(web): replace query hooks with queryOptions factories (#32520) 2026-02-25 00:31:25 +08:00
use-skill-save-manager.spec.tsx feat: enhance configuration and environment setup for SSH sandbox and Creators Platform; update local excludes and improve component logic in the web app 2026-03-24 17:05:56 +08:00
use-skill-save-manager.tsx fix: pass all CI quality checks - ESLint, TypeScript, basedpyright, pyrefly, lint-imports 2026-03-24 10:54:58 +08:00
use-sqlite-database.ts fix: show columns for empty sqlite tables 2026-01-22 16:25:43 +08:00