Skip to content

Conversation

@CodFrm
Copy link
Member

@CodFrm CodFrm commented Jan 5, 2026

概述 Descriptions

close #1035 #942 #1077 #964

变更内容 Changes

截图 Screenshots

@CodFrm CodFrm changed the title fix fix cloud sync issues Jan 5, 2026
@cyfung1031
Copy link
Collaborator

沒詳細看
如兩者代碼string完全一樣,也不要視為更新

@CodFrm
Copy link
Member Author

CodFrm commented Jan 6, 2026

沒詳細看 如兩者代碼string完全一樣,也不要視為更新

如果还要对比代码的话,需要下载一次代码文件,这里我用的读取文件摘要来进行对比

// 过滤掉无变动的文件
if (fileDigestMap[file.script!.name] === file.script!.digest) {
// 删除了之后,剩下的就是需要上传的脚本了
scriptMap.delete(uuid);
return;
}

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

此 PR 旨在修复云同步相关问题(关联 issue #1035, #942, #1077, #964),主要通过引入文件系统速率限制器来控制并发请求数量,优化云端状态同步逻辑,并修正存储配置。

主要变更:

  • 新增 RateLimiter 和 LimiterFileSystem 类,通过控制并发操作数量(默认最大5个)来防止云端服务器速率限制和超时问题
  • 重构云同步状态同步逻辑,改进云端和本地状态的比对和合并策略,确保脚本的启用状态、排序等属性正确同步
  • 将同步相关数据的存储从 chrome.storage.sync 改为 chrome.storage.local,避免同步存储的大小和配额限制

Reviewed changes

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

File Description
packages/filesystem/limiter.ts 新增速率限制器实现,包括 RateLimiter 基础类和 LimiterFileSystem 包装类
packages/filesystem/factory.ts 集成 LimiterFileSystem,为所有文件系统实例添加速率限制功能
src/app/service/service_worker/synchronize.ts 修复存储配置,优化同步状态逻辑,改进 pullScript 方法以正确应用云端状态

Copy link
Contributor

Copilot AI commented Jan 6, 2026

@CodFrm I've opened a new pull request, #1134, to work on those changes. Once the pull request is ready, I'll request review from you.

CodFrm and others added 4 commits January 6, 2026 14:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan

* Apply rate limiting to open, openDir and create operations

Co-authored-by: CodFrm <22783163+CodFrm@users.noreply.github.com>

* Merge fix/cloud-sync and apply rate limiting to open() method

Co-authored-by: CodFrm <22783163+CodFrm@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: CodFrm <22783163+CodFrm@users.noreply.github.com>
@CodFrm CodFrm merged commit a9383d2 into main Jan 6, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants