diff --git a/backend/mpc-system/services/server-party/adapters/output/grpc/message_router_client.go b/backend/mpc-system/services/server-party/adapters/output/grpc/message_router_client.go index d69c3f4e..4104ccbc 100644 --- a/backend/mpc-system/services/server-party/adapters/output/grpc/message_router_client.go +++ b/backend/mpc-system/services/server-party/adapters/output/grpc/message_router_client.go @@ -637,16 +637,28 @@ func (c *MessageRouterClient) JoinSession( } // Convert response to SessionInfo - participants := make([]use_cases.ParticipantInfo, len(resp.OtherParties)) - for i, p := range resp.OtherParties { + // Include both other parties AND self in the participants list + participants := make([]use_cases.ParticipantInfo, 0, len(resp.OtherParties)+1) + + // Add self first + participants = append(participants, use_cases.ParticipantInfo{ + PartyID: partyID, + PartyIndex: int(resp.PartyIndex), + }) + logger.Debug("Added self to participants", + zap.String("party_id", partyID), + zap.Int32("party_index", resp.PartyIndex)) + + // Add other parties + for _, p := range resp.OtherParties { logger.Debug("Received party_index from Message Router", zap.String("party_id", p.PartyId), zap.Int32("party_index", p.PartyIndex)) - participants[i] = use_cases.ParticipantInfo{ + participants = append(participants, use_cases.ParticipantInfo{ PartyID: p.PartyId, PartyIndex: int(p.PartyIndex), - } + }) } sessionInfo := &use_cases.SessionInfo{