Skip to content

🐛 设备相关配置改用 chrome.storage.local,避免跨设备同步#1309

Merged
CodFrm merged 5 commits intomainfrom
fix/device-local-config
Mar 22, 2026
Merged

🐛 设备相关配置改用 chrome.storage.local,避免跨设备同步#1309
CodFrm merged 5 commits intomainfrom
fix/device-local-config

Conversation

@CodFrm
Copy link
Member

@CodFrm CodFrm commented Mar 22, 2026

Checklist / 检查清单

  • Fixes mentioned issues / 修复已提及的问题
  • Code reviewed by human / 代码通过人工检查
  • Changes tested / 已完成测试

Description / 描述

close #1296 fix #1261

问题

cloud_sync.enable 等设备相关配置存储在 chrome.storage.sync,会被 Chrome 同步到所有设备。但 OAuth token 存在 localStorage(不同步),导致:

修改内容

SystemConfig 支持双 storage + 懒迁移src/pkg/config/config.ts

将设备相关的配置项从 chrome.storage.sync 迁移到 chrome.storage.local

  • cloud_syncbackupcat_file_storage — 云存储/备份配置(含设备相关的 filesystem params)
  • vscode_urlvscode_reconnect — VSCode 连接(设备相关)
  • language — 语言偏好
  • script_list_column_width — UI 列宽(取决于屏幕尺寸)
  • check_update — 扩展更新通知及已读状态(各设备已读状态独立)
  • enable_scriptenable_script_incognito — 脚本开关(设备独立)

懒迁移策略:读取时先查 local,没有则回退 sync(兼容旧版本数据),读到后自动迁移到 local 并从 sync 删除。

另外删除了 changetime 死代码(无任何引用)。

Screenshots / 截图

N/A

CodFrm added 3 commits March 22, 2026 12:31
- SystemConfig 支持双 storage(sync/local)+ 懒迁移
- 云同步前预检 OAuth token,无 token 不弹窗
- AuthVerify 加 mutex 防止并发弹窗
- 删除 changetime 死代码

close #1296 fix #1261
@CodFrm CodFrm changed the title 🐛 设备相关配置改用 chrome.storage.local,避免跨设备同步导致的问题 🐛 设备相关配置改用 chrome.storage.local,避免跨设备同步 Mar 22, 2026
@cyfung1031 cyfung1031 marked this pull request as draft March 22, 2026 05:34
@cyfung1031 cyfung1031 marked this pull request as ready for review March 22, 2026 05:44
@CodFrm CodFrm merged commit c5c3564 into main Mar 22, 2026
4 checks passed
@cyfung1031 cyfung1031 deleted the fix/device-local-config branch March 22, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants