From 290b5ea7666504c46174d6351ba2f882ccdff938 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 30 Dec 2025 00:52:28 -0800 Subject: [PATCH] fix(server-party-co-managed): use session_started event for participants list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit session_created event only contains initial co-managed parties, but session_started event contains ALL participants including external parties that joined dynamically via invite code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../server-party-co-managed/cmd/server/main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/mpc-system/services/server-party-co-managed/cmd/server/main.go b/backend/mpc-system/services/server-party-co-managed/cmd/server/main.go index cef97a68..c3c926b4 100644 --- a/backend/mpc-system/services/server-party-co-managed/cmd/server/main.go +++ b/backend/mpc-system/services/server-party-co-managed/cmd/server/main.go @@ -416,11 +416,13 @@ func createCoManagedSessionEventHandler( zap.String("session_id", event.SessionId), zap.String("party_id", partyID)) - // Build SessionInfo from pending session and event data + // Build SessionInfo from session_started event (NOT from pendingSession cache) + // session_started event contains ALL participants who have joined, + // including external parties that joined dynamically after session_created // Note: We already called JoinSession in session_created phase, // so we use ExecuteWithSessionInfo to skip the duplicate JoinSession call - participants := make([]use_cases.ParticipantInfo, len(pendingSession.SelectedParties)) - for i, p := range pendingSession.SelectedParties { + participants := make([]use_cases.ParticipantInfo, len(event.SelectedParties)) + for i, p := range event.SelectedParties { participants[i] = use_cases.ParticipantInfo{ PartyID: p, PartyIndex: i, @@ -430,8 +432,8 @@ func createCoManagedSessionEventHandler( sessionInfo := &use_cases.SessionInfo{ SessionID: pendingSession.SessionID, SessionType: "co_managed_keygen", - ThresholdN: pendingSession.ThresholdN, - ThresholdT: pendingSession.ThresholdT, + ThresholdN: int(event.ThresholdN), + ThresholdT: int(event.ThresholdT), MessageHash: pendingSession.MessageHash, Participants: participants, }