Skip to content

fix(fs):After the file is copied or moved, flush the cache of the directory that was copied or moved to.#592

Merged
PIKACHUIM merged 15 commits intoOpenListTeam:mainfrom
suyunjing-su:fixcache
Jul 24, 2025
Merged

fix(fs):After the file is copied or moved, flush the cache of the directory that was copied or moved to.#592
PIKACHUIM merged 15 commits intoOpenListTeam:mainfrom
suyunjing-su:fixcache

Conversation

@Suyunmeng
Copy link
Copy Markdown
Contributor

@Suyunmeng Suyunmeng commented Jul 4, 2025

Fix caching issues from #476 and #515 and #581

@Suyunmeng Suyunmeng marked this pull request as draft July 4, 2025 11:54
Suyunmeng added 2 commits July 4, 2025 20:21
chore(quark_uc): `webdav_policy` default to native_proxy
@Suyunmeng Suyunmeng marked this pull request as ready for review July 4, 2025 12:28
@jyxjjj jyxjjj requested a review from Copilot July 4, 2025 12:41
Copy link
Copy Markdown
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 ensures that after files or directories are copied, their destination directory cache is refreshed only once per batch by tracking copy tasks, and adds cache-clearing after individual copies. It also bumps the AdditionVersion in the Quark/UC driver and configures proxy settings conditionally.

  • Introduce batchCopyTracker to group copy tasks by destination directory and clear cache post-completion.
  • Add op.ClearCache calls after successful single-file copies in _copy and CopyTask.Run.
  • Update QuarkOrUC.Init to set AdditionVersion = 2 and configure WebdavPolicy when no DownProxyUrl is provided.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/fs/copy.go Implement batch copy tracker, register/complete tasks, and clear cache after copies
drivers/quark_uc/driver.go Change AdditionVersion to 2 and conditionally set WebdavPolicy
Comments suppressed due to low confidence (2)

internal/fs/copy.go:91

  • The new batch copy tracker logic isn't backed by unit tests. Adding tests for task registration, completion behavior, and stale-entry cleanup would help prevent regressions.
// 批量复制任务跟踪器 - 按目标目录聚合所有复制任务

drivers/quark_uc/driver.go:42

  • [nitpick] The updated condition now also checks DownProxyUrl, but the reasoning for this additional check isn't documented. Consider adding a comment explaining why WebProxy and WebdavPolicy are only set when no DownProxyUrl is provided.
			if !d.UseTransCodingAddress && len(d.DownProxyUrl) == 0 {

@Suyunmeng Suyunmeng changed the title fix(fs):After the file is copied, the cache of the copied directory is refreshed fix(fs):After the file is copied or moved, flush the cache of the directory that was copied or moved to. Jul 4, 2025
@j2rong4cn j2rong4cn marked this pull request as draft July 5, 2025 06:39
@PIKACHUIM PIKACHUIM marked this pull request as ready for review July 24, 2025 02:23
@PIKACHUIM PIKACHUIM merged commit 5f03edd into OpenListTeam:main Jul 24, 2025
12 checks passed
@Suyunmeng Suyunmeng deleted the fixcache branch July 26, 2025 17:15
Suyunmeng added a commit that referenced this pull request Jul 30, 2025
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.

4 participants