- [Asynchronous High-Performance Batch Import & Index Persistence Overhaul] (Fixes #3726):
- Asynchronous Streaming Concurrency & Backpressure: Introduced the
batch_import_accountshigh-performance pipeline backed bybuffer_unordered(6)to strictly bound in-flight active tasks, slashing the import duration for 494 accounts from 28 minutes to ~15-20 seconds (>60x speedup) and eradicating memory spikes and kernel OOM terminations caused by unboundedjoin_all. (Fixes #3726) - Scientific Anti-Throttling & IP Protection: Implemented 30ms ~ 90ms dynamic hash jitter to desynchronize concurrent request dispatches, preventing simultaneous requests from hitting Google endpoints on the same millisecond; built-in 1.5s automatic backoff retry on HTTP 429 / rate limits paired with two-stage lightweight validation (verifying Token and user info during import while deferring heavy quota queries), eliminating Google WAF ban risks. (Fixes #3726)
- Eliminating Small-File Iteration Traps & DOM Re-render Avalanches: Overhauled
detect_active_clients_statusto bypass iterating hundreds of individual JSON files and SQLite queries via direct in-memory index comparisons, throttling frontend polling from 5s intervals to window focus-driven triggers; collapsed batch refresh and import index persistence from N writes to a single atomic commit; restricted import UI updates to a lightweight progress bar to eliminate 494 full DOM re-renders. (Fixes #3726) - Strict Idempotency & Orphan File Self-Healing: Enforced dual deduplication via normalized lowercase emails and Refresh Tokens with in-place upserts, reusing existing account IDs and overwriting existing files regardless of repeated additions or delete-readd cycles; introduced
clean_duplicate_account_filesto detect and safely clean up orphan files on disk, ensuring exactly one physical file per account. (Fixes #3726) - Legacy Single-File Auto-Migration & Resilient
-backupProtection: Automatically detects legacy single-file stores (e.g. legacy monolithicaccounts.json), safely generates modern segmentedaccounts/{uuid}.jsonfiles, and createsaccounts.json-backupor<file>-backupfiles with automatic recovery fallbacks if index corruption occurs. (Fixes #3726) - Unified Batch Import/Export Across All Environments: Fully unified high-performance batch import and export workflows across Desktop (Tauri event progress modal), Web (Axum
/accounts/batch-importendpoint), and CLI (at import <file>/at exportcommands). (Fixes #3726)
- Asynchronous Streaming Concurrency & Backpressure: Introduced the
- [异步高性能批量导入与索引持久化重构(根治内存雪崩与 28 分钟导入延迟)] (Fixes #3726):
- 异步流式并发与背压控制: 新增
batch_import_accounts高性能流式处理管道,基于buffer_unordered(6)严格控制在途活跃任务上限,将 494 个账号导入耗时由 28 分钟锐减至 15~20 秒(提速超 60 倍),彻底杜绝join_all造成的内存暴涨与 OOM 内核击毙。(Fixes #3726) - 科学防 Google 风控体系: 注入 30ms ~ 90ms 动态散列微抖动(Jitter),打散并发时序杜绝同一毫秒齐射 Google 接口;集成 429 速率限制 1.5s 自动退避重试与轻量两阶段验证(导入期仅做 Token 验证与用户信息核验,延迟重量级配额探测),从根源杜绝 IP 被封控风险。(Fixes #3726)
- 消除小文件爆炸遍历与前端重绘雪崩: 优化
detect_active_clients_status,废除调用list_accounts()遍历磁盘数百个小文件及 SQLite 密集查询的缺陷,改为内存索引直接比对,并将前端 5 秒轮询优化为窗口焦点感知驱动;批量刷新与批量导入写盘由 N 次聚合为 1 次单次原子提交;前端导入仅刷新进度条,彻底消灭 494 次大 DOM 树全量重排重绘。(Fixes #3726) - 严格幂等性与孤儿文件自愈: 确立小写邮箱与 Refresh Token 双重查重与原地复用(In-Place Upsert),无论重复添加多少次或先删后加均严格复用唯一 ID 并覆盖更新原文件;引入
clean_duplicate_account_files磁盘自愈清理机制,物理级杜绝一个账号出现两个凭据文件。(Fixes #3726) - 旧版单文件自动兼容与
-backup容灾保障: 自动检测并无缝分片升级旧版单文件格式(如包含完整实体的accounts.json),自动重命名保存为accounts.json-backup或<file>-backup;当索引丢失或异常时优先从-backup自动重建,支持随时重新导入。(Fixes #3726) - 全端高性能批量导入导出适配: 全面打通桌面端(Tauri 流式进度弹窗)、网页端(Axum
/accounts/batch-import端点)与命令行端(at import <file>/at export命令),跨平台体验高度一致。(Fixes #3726)
- 异步流式并发与背压控制: 新增
Full Changelog: v4.9.9-beta.5...v4.9.9-beta.6