rwadurian/backend/mpc-system/services
hailin 71eea98ea5 fix(android): 修复连续创建MPC账户失败的bug
问题描述:
- 用户第一次创建MPC账户成功后返回钱包界面
- 再次创建新的MPC账户时,keygen无法自动开始
- 原因是第一次keygen完成后错误地取消了全局会话事件订阅

根本原因分析:
1. startKeygenAsInitiator() 完成时调用了 sessionEventJob?.cancel()
2. sessionEventJob 是在 registerParty() 时启动的全局事件订阅
3. 取消后,新创建的keygen会话无法接收 session_started 事件
4. 导致keygen无法自动触发

对比发现:
- Sign流程在开始前会调用 ensureSessionEventSubscriptionActive() 检查订阅状态
- Keygen流程没有这个检查,存在不一致性

修复方案:
1. 删除 startKeygenAsInitiator() 中的 sessionEventJob?.cancel()
   - 全局订阅不应该在单次操作完成后取消
   - 只在 cancelSession() 和断开连接时才取消

2. 在 createKeygenSession() 开头添加 ensureSessionEventSubscriptionActive()
   - 与sign流程保持一致
   - 即使有其他代码意外取消订阅,也能自我恢复

影响范围:
- TssRepository.kt: startKeygenAsInitiator(), createKeygenSession()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 08:03:28 -08:00
..
account Revert "fix(co-keygen): convert threshold at storage time to match tss-lib convention" 2025-12-31 10:24:25 -08:00
message-router fix(message-router): prevent subscription race condition on gRPC reconnect 2026-01-01 10:04:11 -08:00
server-party fix(participate_signing): 恢复 Execute 方法的 UserShareData 分支 2026-01-26 19:00:52 -08:00
server-party-api fix(context): use parent context instead of Background() to allow proper cancellation 2025-12-06 06:36:34 -08:00
server-party-co-managed fix(mpc): session_started事件携带完整participants列表 2026-01-27 07:26:25 -08:00
service-party-android fix(android): 修复连续创建MPC账户失败的bug 2026-01-27 08:03:28 -08:00
service-party-app fix(tss): 修复备份恢复后签名失败的问题 2026-01-20 00:39:05 -08:00
session-coordinator fix(mpc): session_started事件携带完整participants列表 2026-01-27 07:26:25 -08:00
tss-wasm feat(tss): add real-time round progress from msg.Type() parsing 2026-01-01 22:41:51 -08:00