hailin
3ff38ca9c2
fix(mining-admin): 添加 buildNumber 到版本检查返回结果
...
mining-app VersionInfo.fromJson 要求 buildNumber 字段,
CheckUpdateResult 接口和 checkUpdate 方法之前未包含该字段。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:29:53 -08:00
hailin
96e1fa4534
fix(mining-admin): 适配 mining-app 版本检查 API 格式
...
- CheckUpdateDto: current_version_code 改为 versionCode 匹配 mining-app 请求参数
- MobileVersionController: 响应格式改为 { hasUpdate, latestVersion: {...} } 匹配 mining-app 解析
- TransformInterceptor: 添加 @SkipTransform() 装饰器,移动端版本检查接口跳过响应包装
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:26:13 -08:00
hailin
f595c6f26d
fix(mining-admin): 将 upload DTO 的 changelog 改为可选
...
前端 upload-modal 在用户未填写更新日志时不发送 changelog 字段,
导致 DTO 校验失败返回 400。将 changelog 改为 @IsOptional(),
与前端行为一致。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:13:57 -08:00
hailin
35fc957eaf
fix(mobile-upgrade): 自动解包 mining-admin-service TransformInterceptor 响应
...
mining-admin-service 的 TransformInterceptor 将所有响应包装为
{ success, data, timestamp } 格式,导致前端 .map() 调用崩溃。
在 API client 的 response interceptor 中自动检测并解包,
对不包装响应的 admin-service (1.0) 无影响。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:01:12 -08:00
hailin
4112b45b9e
feat(mining-admin): 新建公开版本管理接口供 mobile-upgrade 前端使用
...
mining-admin-service 有全局 AdminAuthGuard,导致 mobile-upgrade 前端
调用版本接口返回 401。新建 UpgradeVersionController (@Public) 作为
独立的公开接口,路径为 /api/v2/upgrade-versions,不影响现有需认证的
/api/v2/versions 接口。前端 apiPrefix 同步更新。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:53:29 -08:00
hailin
c6137078ff
feat(api-gateway): 添加 mining-admin-upgrade 路由支持股行App版本管理
...
mobile-upgrade 前端通过 /mining-admin/api/v2/versions 访问股行App版本接口,
新增独立的 Kong service 将该路径正确转发到 mining-admin-service:3023。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:37:39 -08:00
hailin
7b7c9cd9f6
Revert "fix(mobile-upgrade): 修复股行App版本管理API路径匹配Kong路由"
...
This reverts commit 5ef0992448 .
2026-01-29 12:30:52 -08:00
hailin
5ef0992448
fix(mobile-upgrade): 修复股行App版本管理API路径匹配Kong路由
...
NEXT_PUBLIC_MINING_API_URL 从 /mining-admin 改为 /api/v2/mining-admin,
apiPrefix 从 /api/v2/versions 改为 /versions,使最终URL匹配Kong路由
/api/v2/mining-admin/*
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:29:39 -08:00
hailin
7e289430ae
feat(auth-service): CDC 同步 wallet_addresses 并提供内部 API
...
- auth-service: 新增 SyncedWalletAddress Prisma model 和 migration
- auth-service: 新增 WalletAddressCdcConsumer 消费 1.0 钱包地址变更
- auth-service: 新增 InternalController 提供 kava 地址查询 API
- trading-service: IdentityClient 改调 auth-service 内部 API
- docker-compose.2.0.yml: 添加 CDC_TOPIC_WALLET_ADDRESSES 和 AUTH_SERVICE_URL
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:20:23 -08:00
hailin
83fa6bec74
feat(c2c): 支持绿积分(GREEN_POINTS)作为默认支付方式
...
- 后端 paymentMethod 字段从 PostgreSQL 枚举改为 String,支持逗号分隔多种支付方式
- 添加数据库迁移将 C2cPaymentMethod 枚举列转为 TEXT 类型
- DTO 验证改为 @IsString() 接受 GREEN_POINTS 及其组合
- 前端保持发送完整的支付方式列表(含 GREEN_POINTS)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 11:39:00 -08:00
hailin
263f1ecf8e
feat(c2c): 卖单自动获取账户ID和Kava地址,移除手动输入
...
后端创建卖单时自动从 identity-service 获取卖家 Kava 地址并存入订单,
前端发布页面自动展示 accountSequence(只读),不再需要手动输入1.0系统ID。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 11:08:56 -08:00
hailin
2b7a30983e
fix(mining-app): 修复贡献值明细筛选栏溢出问题
...
使用 SingleChildScrollView 包装筛选栏,支持横向滚动
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:52:37 -08:00
hailin
c02d0b4c3c
fix(mining-app): 移除遗留的 kDebugMode 调试代码
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:48:51 -08:00
hailin
7560940e14
fix(mining-app): 修复贡献值明细页面筛选和文字溢出问题
...
- 将贡献值记录筛选从客户端过滤改为服务端过滤,解决同伴上贡献值记录无法显示的问题
- 使用 FittedBox 包装三栏统计标签文字,防止"同伴上贡献值"溢出
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:44:12 -08:00
hailin
776d181ef3
fix(trading-service): 修复P2P转账API响应双重包装问题
...
- 移除controller中的手动包装,由TransformInterceptor统一处理
- 前端增加类型检查防止解析错误
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:11:59 -08:00
hailin
28c73136a8
fix(trading-service): 修复P2P转账历史查询参数解析
...
确保 page 和 pageSize 是有效数字,避免 skip: NaN 错误
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:00:28 -08:00
hailin
dcc83b9f79
fix(trading-service): 使用Docker容器名调用auth-service
...
改为使用 auth-service:3024 替代 IP 地址
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:56:24 -08:00
hailin
8b459dd33f
fix(trading-service): 修复P2P转账AUTH_SERVICE_URL默认值
...
默认值从localhost改为内网IP,解决Docker环境中调用auth-service失败的问题
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:49:54 -08:00
hailin
1448435b06
chore(mining-app): 移除发送页面调试日志
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:40:37 -08:00
hailin
6ebc1f8767
fix(mining-app): 添加收款方验证成功提示和调试日志
...
- 验证成功时显示绿色 SnackBar 提示
- 添加调试日志帮助诊断可用余额问题
- 温馨提示中添加积分值获取方式说明
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:26:22 -08:00
hailin
8fe38525a2
fix(mining-app): 验证收款方失败时显示提示信息
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:19:39 -08:00
hailin
40389fcfc7
feat(trading-service, mining-admin-web): 支持在管理后台配置做市商钱包地址
...
- 后端: 在 UpdateConfigDto 和 updateConfig 方法中添加 kavaWalletAddress 字段
- 前端: 在充值对话框中添加钱包地址配置输入框
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 07:53:04 -08:00
hailin
6bcfa18b01
fix(mining-app): 修复转账二维码扫描无效问题
...
- 修改二维码生成格式为 durian://transfer/?phone=xxx (添加路径分隔符)
- 更新解析函数使用正则匹配,兼容新旧格式
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 07:39:42 -08:00
hailin
7a8a3a8fd1
feat(trading-service): 初始化做市商时自动读取环境变量配置钱包地址
...
- 从 FUSDT_MARKET_MAKER_ADDRESS 环境变量读取做市商钱包地址
- 初始化时自动设置 kavaWalletAddress
- 如果做市商已存在但钱包地址为空,也会从环境变量更新
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 07:31:16 -08:00
hailin
812b127ace
fix(trading-service): 添加缺失的数据库字段迁移
...
Schema 中有但 migration 中缺失的字段:
- market_maker_configs: kava_wallet_address, mpc_username
- c2c_orders: seller_kava_address, bot_purchased, payment_tx_hash
这些字段缺失导致 500 错误:
"The column `market_maker_configs.kava_wallet_address` does not exist"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 07:20:21 -08:00
hailin
6be4775506
fix(service-party-android): 导出钱包时自动从后端获取空的 partyId
...
旧版本钱包(MIGRATION_2_3 之前创建的)partyId 为空,导出时会导致备份文件
中 partyId 字段为空。现在导出时检测到 partyId 为空会自动从后端 session
状态 API 获取正确的 partyId,并同时更新本地数据库。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 07:00:01 -08:00
hailin
b4afc4615c
fix(mining-admin-service): 修复 APK 解析和添加 AppVersion migration
...
1. 修复 package-parser.service.ts:
- ApkReader.open 需要文件路径,改为先写入临时文件再解析
- 添加 fs/path/os 模块导入
- 完成后自动清理临时文件
2. 添加 AppVersion 表 migration:
- 创建 Platform 枚举类型 (ANDROID, IOS)
- 创建 app_versions 表
- 添加必要索引
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 22:24:45 -08:00
hailin
fd64903841
fix(mining-admin-service): 添加 adbkit-apkreader 类型声明
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 22:21:18 -08:00
hailin
8314dda670
fix(mining-admin-service): 更新 package-lock.json
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 22:17:01 -08:00
hailin
4ce43c20cc
fix(mining-admin-service): 添加 APK/IPA 解析依赖包
...
添加版本管理所需的包解析依赖:
- adbkit-apkreader: 解析 Android APK 文件
- jszip: 解压 iOS IPA 文件
- plist: 解析 iOS Info.plist 文件
- @types/plist: TypeScript 类型声明
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 22:15:43 -08:00
hailin
edc0ea46c9
fix: 修复 mining-blockchain-service Kafka consumer group 冲突
...
- mining-blockchain-service 使用独立的 consumer group ID,避免与 blockchain-service 冲突
- withdrawal-event-consumer: blockchain-service-withdrawal-events -> mining-blockchain-service-withdrawal-events
- mpc-event-consumer: blockchain-service-mpc-events -> mining-blockchain-service-mpc-events
- deposit-ack-consumer: blockchain-service-deposit-acks -> mining-blockchain-service-deposit-acks
- 更新 docker-compose.yml 和 kafka.config.ts 的默认配置
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 22:05:55 -08:00
hailin
76d566d145
feat: 集成 mining-app 升级和遥测功能,扩展 mobile-upgrade 支持多应用
...
## mining-app (Flutter)
- 新增 updater 模块: 版本检查、APK下载(断点续传+SHA256校验)、安装
- 新增 telemetry 模块: 事件上报、会话追踪、心跳检测(DAU统计)
- 集成原生 MethodChannel 实现 APK 安装
- 在关于页面添加"检查更新"功能入口
## mining-admin-service (NestJS)
- 新增版本管理 API (/api/v2/versions)
- 实现 DDD 架构: Entity, Value Objects, Repository
- 支持 APK/IPA 解析 (需安装 adbkit-apkreader, jszip, plist)
- 支持文件上传和静态文件服务
## mobile-upgrade (Next.js)
- 扩展支持多后端: 榴莲 App (admin-service) + 股行 App (mining-admin-service)
- 添加应用选择器 UI
- 配置独立的 API 端点
## 修复
- 移除未使用的 _apiBaseUrl 字段 (Flutter)
- 替换废弃的 WillPopScope 为 PopScope (Flutter)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:03:26 -08:00
hailin
219fb7bb69
fix(mining-blockchain): 移除旧的 MARKET_MAKER_* 变量名引用
...
- main.ts: 使用 EUSDT/FUSDT_MARKET_MAKER_* 验证配置
- blockchain.config.ts: 使用 eusdtMarketMaker/fusdtMarketMaker 配置
- market-maker-deposit-detection.service.ts: 每种代币使用独立的做市商钱包地址
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:20:48 -08:00
hailin
3b95a8a332
feat(mining-blockchain): 支持 eUSDT 和 fUSDT 独立做市商钱包
...
- 新增 EUSDT_MARKET_MAKER_USERNAME/ADDRESS 配置
- 新增 FUSDT_MARKET_MAKER_USERNAME/ADDRESS 配置
- mpc-signing.client.ts: 分离 eUSDT 和 fUSDT 做市商签名方法
- erc20-transfer.service.ts: 根据代币类型选择对应钱包转账
- transfer.controller.ts: 更新余额查询和状态接口
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:05:15 -08:00
hailin
aa33803d08
fix(mining-blockchain): 修正做市商钱包配置项顺序
...
统一 USERNAME 在前,ADDRESS 在后的格式,与 HOT_WALLET 保持一致
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 18:33:16 -08:00
hailin
cfdcd9352a
feat(mining-blockchain-service): 支持做市商独立MPC钱包签名
...
- MpcSigningClient 支持两个钱包: C2C Bot 和做市商
- HOT_WALLET_USERNAME/ADDRESS: C2C Bot 热钱包
- MARKET_MAKER_MPC_USERNAME/WALLET_ADDRESS: 做市商钱包
- Erc20TransferService 新增 transferTokenAsMarketMaker() 方法
- eUSDT/fUSDT 转账使用做市商钱包签名和转账
- 新增 /transfer/market-maker/status 状态检查接口
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 18:27:09 -08:00
hailin
4283a369ae
fix(mining-blockchain-service): 修复Redis DB配置超出范围问题
...
- 将 REDIS_DB 从 16 改为 8(Redis 仅支持 0-15)
- 更新 .env.example 添加做市商钱包配置说明
- 添加 eUSDT/fUSDT 合约地址配置
- 添加区块扫描配置项
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 18:16:38 -08:00
hailin
58feec255d
feat(market-maker): 实现做市商区块链充提功能
...
- 扩展 mining-blockchain-service 支持 eUSDT/fUSDT 转账
- 添加 trading-service 区块链提现 API(自动回滚失败交易)
- 前端支持中心化和区块链充提两种模式(Tab切换)
- 区块链充值显示钱包地址和二维码
- 区块链提现支持输入目标地址直接转账
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:56:15 -08:00
hailin
94f9e7d5b5
fix(trading-service): 使用事务确保成交时账户余额更新的原子性
...
## 问题描述
用户 D25122700015 的卖单成交后,订单状态变为 FILLED,成交记录存在,
但 frozenShares 未释放,cashBalance 未增加,交易流水缺少 SELL 记录。
## 根本原因
`tryMatch` 方法中的数据库操作没有使用事务:
1. trade.create - 单独提交
2. orderRepository.save - 单独提交
3. accountRepository.save(buyerAccount) - 单独提交
4. accountRepository.save(sellerAccount) - 可能因前面异常而跳过
如果步骤 1-3 成功但步骤 4 失败,会导致:
- 成交记录存在 ✓
- 订单状态 FILLED ✓
- 买方账户正常 ✓
- 卖方账户未更新 ✗
## 修复方案
使用 Prisma 事务包装所有关键操作,确保原子性:
1. 创建成交记录
2. 更新买单状态
3. 更新卖单状态(含销毁信息)
4. 更新买方账户(扣除冻结现金,增加积分股)
5. 更新卖方账户(扣除冻结积分股,增加现金)
6. 记录交易流水
任何一步失败,整个事务回滚。
## 受影响用户
- D25122700015: 订单 OMKXYTXS6KKC3A6
- 成交记录: TMKXYTXXH8CYQZ7
- 需要手动修复现有数据
## 回滚方法
git revert <此commit>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:20:31 -08:00
hailin
1974c43eba
feat(market-maker): 实现做市商区块链充值监控功能
...
- mining-blockchain-service:
- 添加 MarketMakerDeposit 和 MarketMakerBlockCheckpoint 表
- 添加 eUSDT/fUSDT 代币合约配置
- 实现做市商钱包充值检测服务
- 添加启动时配置验证和错误日志
- 发布充值确认事件到 Kafka
- trading-service:
- 添加做市商充提记录表 (MarketMakerDeposit, MarketMakerWithdraw)
- 添加 Kafka 消费者监听充值确认事件
- 实现充值自动入账和流水记录
- 部署配置:
- 更新 docker-compose 添加新环境变量
- 更新 deploy-mining.sh 添加 blockchain 服务
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:13:41 -08:00
hailin
a2da841d59
feat(transfer): 添加扫码转账功能
...
- 添加 mobile_scanner 依赖用于二维码扫描
- 创建 QrScannerSheet 组件,支持底部弹窗扫码
- 发送积分值页面添加扫码按钮,扫描后自动填入收款方手机号
- 支持解析 durian://transfer?phone={phone} 格式的二维码
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:22:53 -08:00
hailin
0c0750ce93
feat(c2c): 前端添加 Bot 自动购买信息展示
...
- C2cOrderModel 添加 botPurchased/sellerKavaAddress/paymentTxHash 字段
- 订单详情页新增 Bot 支付信息卡片,显示 dUSDT 交易哈希
- 支持复制 Kava 地址和交易哈希
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 07:26:36 -08:00
hailin
042a52550b
feat(c2c): 实现C2C Bot自动交易系统
...
- 创建独立的 mining-blockchain-service 服务 (基于 blockchain-service)
- 添加 dUSDT 转账接口供 C2C Bot 调用
- 实现 C2cBotService 自动购买卖单
- 实现 C2cBotScheduler 每10秒扫描待处理卖单
- 添加 BlockchainClient 和 IdentityClient 客户端
- 更新 C2cOrder 模型添加 Bot 购买相关字段
- 使用 MPC 热钱包签名交易
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 07:10:25 -08:00
hailin
cec98e9d3e
feat(contribution): 添加定时任务补发未完全解锁的贡献值
...
每10分钟扫描已认种但解锁状态不完整的账户,检查其直推用户认种情况,
若满足新的解锁条件则自动补发层级贡献值和奖励档位。
- 添加 findAccountsWithIncompleteUnlock 查询方法
- 添加 findPendingLevelByAccountSequence 和 claimLevelRecords 方法
- 实现 processBackfillForAccount 和 claimLevelContributions 补发逻辑
- 添加 processContributionBackfill 定时任务(每10分钟执行)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 06:25:57 -08:00
hailin
2597d0ef46
feat: 实现P2P转账功能及前端资产页面优化
...
- trading-service: 添加P2pTransfer模型和P2P转账API
- auth-service: 添加用户手机号查询接口用于转账验证
- frontend: 修复资产页面冻结份额显示和转账页面余额字段
- frontend: 添加P2P转账记录页面
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 06:25:42 -08:00
hailin
06dbe133c2
fix(android): 修复rebuild选项删除aar后未重建的bug
...
将rebuild参数解析移到tsslib.aar存在检查之前,
确保删除aar后能触发gomobile重新编译。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 10:13:27 -08:00
hailin
263be15028
fix(android): 修复重连时gRPC流异常导致待机闪退
...
问题:心跳失败触发重连时,shutdownNow关闭旧channel会导致
gRPC流抛出UNAVAILABLE异常,虽然检测到过时流但仍传播异常
到TssRepository的collect协程,导致应用崩溃。
修复:
- GrpcClient: 过时流错误时使用close()而非close(t)避免传播异常
- GrpcClient: 添加shutdownNow错误检测避免不必要的重连
- TssRepository: 为subscribeSessionEvents和subscribeMessages流添加.catch
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 09:52:57 -08:00
hailin
d83c859965
debug(android): 添加崩溃日志和调试信息定位待机闪退问题
...
- TssPartyApplication: 添加全局异常捕获,崩溃日志保存到文件
- GrpcClient: 心跳失败、重连、流重订阅添加 [IDLE_CRASH_DEBUG] 日志
- TssRepository: 轮询超时和回调调用添加调试日志
- MainViewModel: session事件回调用try-catch包装
日志筛选: adb logcat | grep "IDLE_CRASH_DEBUG"
崩溃日志: /data/data/com.durian.tssparty/files/crash_logs/
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 09:36:00 -08:00
hailin
b4541129aa
feat(android): 添加rebuild选项强制重新编译Go代码
...
问题:
- build-apk.bat 只在 tsslib.aar 不存在时才编译Go代码
- clean 选项只清理Gradle构建文件,不删除tsslib.aar
- 导致Go代码修改后无法被编译进APK
解决方案:
- 添加 rebuild 选项到 build-apk.bat 和 build-install-debug.bat
- rebuild 会删除 tsslib.aar 并强制重新编译Go代码
使用方法:
- build-apk.bat rebuild # 重新编译Go并构建APK
- build-install-debug.bat rebuild # 重新编译Go并安装调试APK
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 09:19:22 -08:00
hailin
8a9a983cbd
fix(android): 使用同步标志修复参与方显示4/3的竞态条件bug
...
问题根因:
- 之前使用异步的 sessionStatus 检查来防止 participant_joined 事件
在 session_started 之后继续添加参与方
- 但 sessionStatus 是通过 StateFlow 异步更新的,检查时状态可能还未更新
- 导致 participant_joined 事件仍能添加额外的参与方,显示4/3而非3/3
解决方案:
- 添加同步标志 sessionStartedForSession: String?
- 在 session_started 处理器的最开始同步设置此标志
- 在 participant_joined 处理器中检查此标志,而非异步状态
- 由于回调是顺序处理的,这种方式100%可靠
修改内容:
1. 添加 sessionStartedForSession 私有成员变量
2. 在 session_started 事件处理开始时立即设置标志
3. 在 participant_joined 事件处理开始时检查标志
4. 在所有 reset 方法中重置标志:
- resetSessionState()
- resetJoinKeygenState()
- resetCoSignState()
- resetTransferState()
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 09:08:13 -08:00