feat(expo): 后台超过 5 分钟才断开会话 WebSocket
- 进入 background 后延迟释放长连,回到前台则取消计时;短切应用保持连接 - 池支持 subscribeConversationPoolSlotDisposed;聊天页在槽位释放时同步状态 - 前台 active 时按需 connect 或重绑会话 - backgroundDisconnectAfterMs 默认 300_000(5 分钟) 未纳入:api/uploads/ 本地文件 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -21,5 +21,10 @@ export const config = {
|
||||
reconnectBaseDelayMs: 1_000,
|
||||
reconnectMaxDelayMs: 30_000,
|
||||
heartbeatIntervalMs: 30_000,
|
||||
/**
|
||||
* 仅当 App 处于 `background` 连续超过该毫秒数才释放当前会话 WebSocket。
|
||||
* 短暂切到其它应用再返回时保持连接,避免反复重连。
|
||||
*/
|
||||
backgroundDisconnectAfterMs: 300_000,
|
||||
},
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user