From 422d7007b10ff6fbf5ba5e1ecd231447e0015816 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 29 Dec 2025 11:54:14 -0800 Subject: [PATCH] =?UTF-8?q?fix(service-party-app):=20=E8=A1=A5=E5=85=A8=20?= =?UTF-8?q?getSessionStatus=20=E8=BF=94=E5=9B=9E=E7=9A=84=20threshold=20?= =?UTF-8?q?=E5=92=8C=20participants?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题: - Session.tsx 期望 session 对象有 threshold 和 participants 字段 - 但 grpc:getSessionStatus 只返回了基础字段 - 导致前端显示 参与方 (0 / 0) 修复: - 从 activeKeygenSession 获取 threshold 信息 - 从 API 返回的 participants 构建完整的参与者列表 - 添加 walletName, currentRound, totalRounds 字段 Generated with Claude Code Co-Authored-By: Claude Opus 4.5 --- .../services/service-party-app/electron/main.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backend/mpc-system/services/service-party-app/electron/main.ts b/backend/mpc-system/services/service-party-app/electron/main.ts index f6c80c82..ebd4ceaf 100644 --- a/backend/mpc-system/services/service-party-app/electron/main.ts +++ b/backend/mpc-system/services/service-party-app/electron/main.ts @@ -859,15 +859,30 @@ function setupIpcHandlers() { ipcMain.handle('grpc:getSessionStatus', async (_event, { sessionId }) => { try { const result = await accountClient?.getSessionStatus(sessionId); + // 从 activeKeygenSession 获取更完整的信息 + const threshold = activeKeygenSession?.threshold || { t: 0, n: result?.total_parties || 0 }; + const participants = result?.participants?.map((p, idx) => ({ + partyId: p.party_id, + partyIndex: p.party_index, + name: activeKeygenSession?.participants?.find(ap => ap.partyId === p.party_id)?.name || `参与方 ${idx + 1}`, + status: p.status, + joinedAt: new Date().toISOString(), + })) || []; + return { success: true, session: { sessionId: result?.session_id, + walletName: activeKeygenSession?.walletName || '', status: result?.status, completedParties: result?.completed_parties, totalParties: result?.total_parties, sessionType: result?.session_type, publicKey: result?.public_key, + threshold: threshold, + participants: participants, + currentRound: 0, + totalRounds: 4, }, }; } catch (error) {