Fix workflow knowledge retrieval cache bug
🐛 Fixed issue where deleted datasets appeared as blank options in workflow knowledge retrieval nodes ## Problem - After deleting a dataset and adding a new one, workflow knowledge retrieval nodes showed both a blank option (ghost data) and the correct new dataset - Issue was caused by stale SWR cache and improper initialization of SelectDataset component ## Root Causes 1. SelectDataset component created 'ghost' objects with only IDs but no names during initialization 2. SWR cache was not properly invalidated when datasets were deleted ## Solutions 1. **Fixed SelectDataset initialization**: Avoid creating ghost objects, properly initialize selected state after data loads 2. **Added SWR cache invalidation**: Clear all dataset-related cache when a dataset is deleted ## Files Changed - web/app/components/app/configuration/dataset-config/select-dataset/index.tsx - web/app/(commonLayout)/datasets/DatasetCard.tsx - clickzetta/build-local-dify-web.sh (new build script for testing) ## Testing ✅ Verified in Docker environment: ghost options no longer appear after dataset deletion ✅ Page refresh is no longer needed to see correct state 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>pull/22673/head
parent
18230d12f9
commit
5a7d32e2ab
Loading…
Reference in New Issue