Skip to content

Conversation

@varg1714
Copy link
Contributor

Description / 描述

在对文件夹重命名后清除原文件夹下的缓存数据。

Motivation and Context / 背景

修复缓存问题,复现步骤如下:

  1. 原文件夹名称为 dir
  2. 点击文件夹列出文件列表 list
  3. 修改文件夹名称为 dir-bak
  4. 新建文件夹,名称为 dir
  5. 点击name,数据显示为原dir文件夹下的数据
  6. 强制刷新,显示正常

How Has This Been Tested? / 测试

  1. 原文件夹状态
图片 图片
  1. 重命名文件夹并新建相同名称文件夹
图片 3. 进入新建立的文件夹 图片 4. 强制刷新 图片

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

@ILoveScratch2 ILoveScratch2 requested review from Copilot and sevxn007 and removed request for sevxn007 August 31, 2025 08:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a cache issue that occurs after renaming directories. When a directory is renamed and a new directory with the same name is created, the old cached data would still be displayed instead of the new directory's contents.

Key changes:

  • Added cache clearing logic after directory rename operations to prevent stale cache data
  • Applied the fix to both driver.RenameResult and driver.Rename code paths

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ILoveScratch2 ILoveScratch2 changed the title fix(fs): Clear cache after renaming the directory. fix(fs): clear cache after directory rename to ensure consistency Sep 1, 2025
@ILoveScratch2 ILoveScratch2 merged commit 89f3517 into OpenListTeam:main Sep 1, 2025
14 checks passed
ForSourceCodeAnalysis pushed a commit to ForSourceCodeAnalysis/OpenList that referenced this pull request Oct 4, 2025
@varg1714 varg1714 deleted the fix/varg-0831-fs-cache branch November 4, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants