fix(server-party-co-managed): use session_started event for participants list

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 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-30 00:52:28 -08:00
parent 2164664ca0
commit 290b5ea766
1 changed files with 7 additions and 5 deletions

View File

@ -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,
}