From 21985abde534a415c44395de8579da0e07411268 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 29 Dec 2025 03:07:44 -0800 Subject: [PATCH] =?UTF-8?q?fix(session-coordinator):=20=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=20WalletName=20=E5=92=8C=20InviteCode=20=E5=88=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CreateSessionInput 添加 WalletName 和 InviteCode 字段 - gRPC handler 从请求中读取并传递这些字段 - CreateSession use case 在创建会话时设置这些字段 修复: 通过邀请码查询会话时找不到记录的问题 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../adapters/input/grpc/session_grpc_handler.go | 2 ++ .../ports/input/session_management_port.go | 2 ++ .../application/use_cases/create_session.go | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/backend/mpc-system/services/session-coordinator/adapters/input/grpc/session_grpc_handler.go b/backend/mpc-system/services/session-coordinator/adapters/input/grpc/session_grpc_handler.go index 2748a45a..95c9fbd0 100644 --- a/backend/mpc-system/services/session-coordinator/adapters/input/grpc/session_grpc_handler.go +++ b/backend/mpc-system/services/session-coordinator/adapters/input/grpc/session_grpc_handler.go @@ -159,6 +159,8 @@ func (s *SessionCoordinatorServer) CreateSession( Participants: participants, MessageHash: req.MessageHash, ExpiresIn: time.Duration(req.ExpiresInSeconds) * time.Second, + WalletName: req.WalletName, + InviteCode: req.InviteCode, } // Parse and set keygen_session_id if provided (for signing sessions) diff --git a/backend/mpc-system/services/session-coordinator/application/ports/input/session_management_port.go b/backend/mpc-system/services/session-coordinator/application/ports/input/session_management_port.go index d3caf58e..6c9cecea 100644 --- a/backend/mpc-system/services/session-coordinator/application/ports/input/session_management_port.go +++ b/backend/mpc-system/services/session-coordinator/application/ports/input/session_management_port.go @@ -55,6 +55,8 @@ type CreateSessionInput struct { ExpiresIn time.Duration DelegateUserShare *DelegateUserShare // For sign sessions with delegate party KeygenSessionID uuid.UUID // For sign sessions: which keygen session's shares to use + WalletName string // For co_managed_keygen: wallet name + InviteCode string // For co_managed_keygen: invite code for participants } // ParticipantInfo contains information about a participant diff --git a/backend/mpc-system/services/session-coordinator/application/use_cases/create_session.go b/backend/mpc-system/services/session-coordinator/application/use_cases/create_session.go index dabd8029..cadb8bf4 100644 --- a/backend/mpc-system/services/session-coordinator/application/use_cases/create_session.go +++ b/backend/mpc-system/services/session-coordinator/application/use_cases/create_session.go @@ -138,6 +138,18 @@ func (uc *CreateSessionUseCase) Execute( zap.String("keygen_session_id", req.KeygenSessionID.String())) } + // 4.2 Set wallet name and invite code for co_managed_keygen sessions + if req.WalletName != "" { + session.WalletName = req.WalletName + } + if req.InviteCode != "" { + session.InviteCode = req.InviteCode + logger.Info("Co-managed keygen session created with invite code", + zap.String("session_id", session.ID.String()), + zap.String("wallet_name", req.WalletName), + zap.String("invite_code", req.InviteCode)) + } + // 5. Add participants and generate join tokens tokens := make(map[string]string) if len(req.Participants) == 0 {