mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +08:00
fix(workflow): prevent redundant sandbox download refetch after reset
Problem:\n- In variable inspect artifacts view, clicking Reset All invalidates sandbox download query keys.\n- If a previously selected file has been removed, the download-url query may still refetch with stale path and return 400.\n- Default query retry amplifies this into repeated failed requests in this scenario.\n\nSolution:\n- Extend sandbox file invalidation with an option to skip download query refetch.\n- Use that option in Reset All flow so download-url queries are marked stale without immediate refetch.\n- Derive selected file path from latest sandbox flat data and disable download-url query when file no longer exists.\n- Disable retry only for artifacts-tab download-url query to avoid repeated 400 retries in this path.\n- Align tree selectedPath with derived selectedFilePath and add hook tests for invalidation behavior.\n\nValidation:\n- pnpm vitest --run service/use-sandbox-file.spec.tsx
This commit is contained in:
@ -224,7 +224,7 @@ export const useInspectVarsCrudCommon = ({
|
||||
await Promise.all([
|
||||
invalidateConversationVarValues(),
|
||||
invalidateSysVarValues(),
|
||||
invalidateSandboxFiles(),
|
||||
invalidateSandboxFiles({ refetchDownloadFile: false }),
|
||||
])
|
||||
deleteAllInspectVars()
|
||||
handleEdgeCancelRunningStatus()
|
||||
|
||||
Reference in New Issue
Block a user