fix(account): move messageHashHex calculation before fallback in GetSignSessionByInviteCode

Ensure message_hash is returned even when GetSessionStatus fails.

🤖 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 07:53:15 -08:00
parent ec7a25179d
commit 988f8797dd
1 changed files with 7 additions and 6 deletions

View File

@ -647,6 +647,12 @@ func (h *CoManagedHTTPHandler) GetSignSessionByInviteCode(c *gin.Context) {
return
}
// Convert message_hash to hex string (for fallback response too)
messageHashHex := ""
if len(messageHash) > 0 {
messageHashHex = hex.EncodeToString(messageHash)
}
// Get session status from coordinator
statusResp, err := h.sessionCoordinatorClient.GetSessionStatus(ctx, sessionID)
if err != nil {
@ -658,6 +664,7 @@ func (h *CoManagedHTTPHandler) GetSignSessionByInviteCode(c *gin.Context) {
"session_id": sessionID,
"keygen_session_id": keygenSessionID,
"wallet_name": walletName,
"message_hash": messageHashHex,
"threshold_n": thresholdN,
"threshold_t": thresholdT,
"status": status,
@ -696,12 +703,6 @@ func (h *CoManagedHTTPHandler) GetSignSessionByInviteCode(c *gin.Context) {
}
}
// Convert message_hash to hex string
messageHashHex := ""
if len(messageHash) > 0 {
messageHashHex = hex.EncodeToString(messageHash)
}
logger.Info("Found sign session for invite_code",
zap.String("invite_code", inviteCode),
zap.String("session_id", sessionID),