Skip to content

fix: 连接断开时作废当前同步 context - #241

Open
CorrectRoadH wants to merge 1 commit into
haierkeys:masterfrom
CorrectRoadH:upstream/fix/close-clear-sync-context
Open

fix: 连接断开时作废当前同步 context#241
CorrectRoadH wants to merge 1 commit into
haierkeys:masterfrom
CorrectRoadH:upstream/fix/close-clear-sync-context

Conversation

@CorrectRoadH

Copy link
Copy Markdown
Contributor

问题

websocket_manager.tsonClose 里只把 isSyncing 置回 false,但 activeSyncContext 还留着。这样一来:

  • 重入保护没了 —— 重连后能立刻再开一轮同步;
  • 在途的全库扫描不知道自己该停,会一路扫到底,再用一个早就断掉的连接发完整一轮数据。

修复

断开时一并清空 activeSyncContext,配合扫描循环里的 context 归属检查,在途扫描会在下一个让出点自行退出。

已跑 tsc -noEmit -skipLibCheck 通过。

🤖 Generated with Claude Code

https://claude.ai/code/session_01T2QYrNjmd1hNqgzWyR4jFZ

onClose 只把 isSyncing 置 false,同步 context 还留着。在途的全库扫描既失去了
重入保护,又不知道自己该停,会一路扫完并用已断开的连接发一轮数据。

断开时一并清空 activeSyncContext,让扫描循环在下一个让出点自行退出。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T2QYrNjmd1hNqgzWyR4jFZ
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.

1 participant