rwadurian/backend/mpc-system/services/service-party-android/app
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
..
libs feat(android): add Android TSS Party app with full API implementation 2025-12-31 23:27:29 -08:00
src/main fix(android): 修复连续创建MPC账户失败的bug 2026-01-27 08:03:28 -08:00
build.gradle.kts fix(tss): 修复备份恢复后签名失败的问题 2026-01-20 00:39:05 -08:00
proguard-rules.pro feat(android): add Android TSS Party app with full API implementation 2025-12-31 23:27:29 -08:00