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:
parent
674bc9e5cd
commit
c0e292535d
|
|
@ -384,13 +384,23 @@ export class TSSHandler extends EventEmitter {
|
||||||
* 1. isPrepared=true, isRunning=false: 预订阅阶段,缓冲消息
|
* 1. isPrepared=true, isRunning=false: 预订阅阶段,缓冲消息
|
||||||
* 2. isPrepared=true, isRunning=true, isProcessReady=false: 进程启动中,缓冲消息
|
* 2. isPrepared=true, isRunning=true, isProcessReady=false: 进程启动中,缓冲消息
|
||||||
* 3. isPrepared=true, isRunning=true, isProcessReady=true: 进程就绪,直接发送
|
* 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: {
|
private handleIncomingMessage(rawMessage: {
|
||||||
messageId: string;
|
message_id: string;
|
||||||
fromParty: string;
|
from_party: string;
|
||||||
isBroadcast: boolean;
|
is_broadcast: boolean;
|
||||||
payload: Buffer;
|
payload: Buffer;
|
||||||
}): void {
|
}): 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 && message.messageId) {
|
||||||
if (this.database.isMessageProcessed(message.messageId)) {
|
if (this.database.isMessageProcessed(message.messageId)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue