Skip to content

feat: 添加断开自动重连功能#1

Merged
apoint123 merged 1 commit intoamll-dev:mainfrom
Shomi-FJS:main
Mar 29, 2026
Merged

feat: 添加断开自动重连功能#1
apoint123 merged 1 commit intoamll-dev:mainfrom
Shomi-FJS:main

Conversation

@Shomi-FJS
Copy link
Copy Markdown
Contributor

  • 新增 autoReconnectAtom 状态存储重连设置
  • 断开后 200ms 立即重连一次,之后每 3 秒重试
  • 连接成功后清除重连定时器
  • 手动断开不会触发自动重连
  • 切换开关立即生效
  • 连接成功后清除错误提示
  • 设置界面新增断开自动重连开关
  • 同时在UI页面增加了用户设置开关

Copy link
Copy Markdown

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 在现有 WebSocket 连接管理基础上,引入“断开后自动重连”的用户设置与实现逻辑,提升连接稳定性与可用性。

Changes:

  • 新增 autoReconnectAtom 持久化存储自动重连开关状态
  • AmllWsClient 中实现断开后 200ms 立即重连、之后每 3 秒重试,并在连接成功后清理重连定时器与错误提示
  • 在设置界面新增“断开自动重连”开关供用户控制

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/store/index.ts 新增 autoReconnectAtom 作为自动重连开关的持久化状态
src/components/headless/AmllWsClient.tsx 增加重连定时器/逻辑,并在连接成功后清理与清空错误提示
src/App.tsx 设置页新增“断开自动重连”开关入口

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- 新增 autoReconnectAtom 状态存储重连设置
- 断开后每 3 秒自动重连
- 连接成功后清除重连定时器
- 手动断开不会触发自动重连
- 切换开关立即生效
- 连接成功后清除错误提示
- 设置界面新增断开自动重连开关
@apoint123 apoint123 merged commit 1a9cf07 into amll-dev:main Mar 29, 2026
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.

3 participants