fix(service-party-app): 修复 handleIncomingMessage 字段名 snake_case 问题

问题:
- gRPC proto-loader 使用 keepCase: true,返回 snake_case 字段名
- tss-handler.ts 的 handleIncomingMessage 期望 camelCase 字段名
- 导致 message_id, from_party, is_broadcast 等字段无法正确读取
- TSS 进程无法收到正确的消息,keygen 无法完成

修复:
- handleIncomingMessage 参数改为 snake_case (message_id, from_party, is_broadcast)
- 内部转换为 camelCase 格式后处理

🤖 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-29 12:53:26 -08:00
parent 674bc9e5cd
commit c0e292535d
1 changed files with 14 additions and 4 deletions

View File

@ -384,13 +384,23 @@ export class TSSHandler extends EventEmitter {
* 1. isPrepared=true, isRunning=false:
* 2. isPrepared=true, isRunning=true, isProcessReady=false:
* 3. isPrepared=true, isRunning=true, isProcessReady=true:
*
* Note: gRPC message uses snake_case field names due to keepCase: true in proto-loader
*/
private handleIncomingMessage(message: {
messageId: string;
fromParty: string;
isBroadcast: boolean;
private handleIncomingMessage(rawMessage: {
message_id: string;
from_party: string;
is_broadcast: boolean;
payload: Buffer;
}): void {
// 转换为内部使用的 camelCase 格式
const message = {
messageId: rawMessage.message_id,
fromParty: rawMessage.from_party,
isBroadcast: rawMessage.is_broadcast,
payload: rawMessage.payload,
};
// 消息去重检查
if (this.database && message.messageId) {
if (this.database.isMessageProcessed(message.messageId)) {