Resources folder state sync issue: "Ghost folder" remains in UI after deletion & Rename fails
问题描述 (Description)
在“资源”菜单中管理文件夹时,存在前端状态同步异常的问题。删除文件夹后,后端已成功处理请求(文件系统和数据库均已删除),但前端 UI 没有更新,导致列表中残留一个“幽灵文件夹”。后续对这个幽灵文件夹的任何操作都会触发后端报错。
When managing folders in the "Resources" menu, there seems to be a frontend state synchronization issue. After deleting a folder, the backend successfully processes the request (deleted in DB/FileSystem), but the frontend UI does not update, leaving a "ghost" folder visible. Subsequent operations on this ghost folder result in backend errors.
复现步骤 (Steps to Reproduce)
- 进入 资源 (Resources) 菜单,点击新增按钮创建一个文件夹(例如命名为
test)。 - 问题 1(重命名报错):尝试对刚创建的文件夹进行重命名,直接报错。
- 问题 2(幽灵文件夹):删除该文件夹。后端返回删除成功,但前端 UI 没有刷新,文件夹依然显示在列表中。
- 问题 3(操作幽灵节点):选中这个依然可见的“幽灵文件夹”并尝试 重命名。由于服务器上已不存在该文件夹,触发报错(如
ENOENT)。 - 问题 4(操作幽灵节点):再次尝试 删除 这个可见的“幽灵文件夹”,同样报错。
- Go to the Resources menu and create a new folder (e.g., named
test). - Issue 1 (Rename Fails): Try to rename the newly created folder immediately. It throws an error.
- Issue 2 (Ghost Folder): Delete the folder. The backend returns a success response, but the frontend UI does not update, and the folder remains visible in the list.
- Issue 3 (Operate on Ghost): Select this visible "ghost" folder and try to Rename it. It throws an error (e.g.,
ENOENT) because the folder no longer exists on the server. - Issue 4 (Operate on Ghost): Try to Delete this visible "ghost" folder again. It also throws an error.
预期行为 vs 实际行为 (Expected vs Actual Behavior)
预期行为:删除文件夹后,前端应立即从列表中移除该节点;重命名应无缝同步前后端。
实际行为:删除后前端状态未更新,残留“幽灵节点”;对幽灵节点的后续操作均因文件不存在而失败。
Expected Behavior: Deleting a folder should immediately remove it from the frontend UI; renaming should sync seamlessly.
Actual Behavior: Frontend state is not updated after deletion, leaving a "ghost" node; subsequent operations on this ghost node fail because the file no longer exists.
环境信息 (Environment)
已在本地自托管环境复现(树莓派 ARM64 架构,使用 PostgreSQL 17 + pgvector)。
在官方 Blinko Demo 站点中同样复现此问题。
Reproduced on local self-hosted instances (ARM64 Raspberry Pi , using PostgreSQL 17 with pgvector).
Also reproduced on the official Blinko Demo site.
Problem description (Description)
When managing folders in the "Resources" menu, there is an issue where the front-end status synchronization is abnormal. After deleting the folder, the backend successfully processed the request (both file system and database were deleted), but the frontend UI was not updated, resulting in a "ghost folder" remaining in the list. Any subsequent operations on this ghost folder will trigger a backend error.
When managing folders in the "Resources" menu, there seems to be a frontend state synchronization issue. After deleting a folder, the backend successfully processes the request (deleted in DB/FileSystem), but the frontend UI does not update, leaving a "ghost" folder visible. Subsequent operations on this ghost folder result in backend errors.
Steps to Reproduce
- Enter the Resources menu and click the New button to create a folder (for example, named
test). - Question 1 (rename error): Try to rename the newly created folder, and an error will be reported directly.
- Issue 2 (Ghost Folder): Delete the folder. The backend returns that the deletion was successful, but the frontend UI is not refreshed and the folder is still displayed in the list.
- Question 3 (Manipulating Ghost Nodes): Select this "ghost folder" that is still visible and try to rename it. Since the folder no longer exists on the server, an error (such as
ENOENT) is triggered. - Question 4 (Operation ghost node): Try again to delete this visible "ghost folder", and the same error is reported.
- Go to the Resources menu and create a new folder (e.g., named
test). - Issue 1 (Rename Fails): Try to rename the newly created folder immediately. It throws an error.
- Issue 2 (Ghost Folder): Delete the folder. The backend returns a success response, but the frontend UI does not update, and the folder remains visible in the list.
- Issue 3 (Operate on Ghost): Select this visible "ghost" folder and try to Rename it. It throws an error (e.g.,
ENOENT) because the folder no longer exists on the server. - Issue 4 (Operate on Ghost): Try to Delete this visible "ghost" folder again. It also throws an error.
Expected vs Actual Behavior (Expected vs Actual Behavior)
Expected Behavior: After deleting a folder, the frontend should immediately remove the node from the list; renaming should synchronize the frontend and backend seamlessly.
Actual behavior: The front-end status is not updated after deletion, and "ghost nodes" remain; subsequent operations on the ghost nodes fail because the file does not exist.
Expected Behavior: Deleting a folder should immediately remove it from the frontend UI; renaming should sync seamlessly.
Actual Behavior: Frontend state is not updated after deletion, leaving a "ghost" node; subsequent operations on this ghost node fail because the file no longer exists.
Environment information (Environment)
Reproduced in local self-hosted environment (Raspberry Pi ARM64 architecture, using PostgreSQL 17 + pgvector).
**This problem is also reproduced in the official Blinko Demo site. **
Reproduced on local self-hosted instances (ARM64 Raspberry Pi, using PostgreSQL 17 with pgvector).
Also reproduced on the official Blinko Demo site.
Source: blinkospace/blinko