refactor(bridge): split MsgPush handler into per-PkgType decoders

The 885-line msg-push-handler.ts is replaced by bridge/msg-push/:
8 per-PkgType decoders plus MsgPushRegistry (single decoder per
PkgType, catch + log on error), MsgPushContext (header decoded
once at entry), and rich-body-decoder (one deep function hides
~400 lines of element conversion shared by all three message
types).

parseMsgPush(pkt, identity) signature preserved; existing tests
pass with an import-path change only.
This commit is contained in:
DrSmoothl committed 2026-05-15 14:32:34 +08:00
1 parent 1a072bc6f1
commit 6b236f70bf
18 files changed
+1136 -888

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ import type { Bridge } from '../bridge';
import { gunzipSync, gzipSync } from 'zlib';
import { protoDecode, protoEncode } from '../../protobuf/decode';
import { buildSendElems } from '../element-builder';
import { parseMsgPush } from '../msg-push-handler';
import { parseMsgPush } from '../msg-push';
import type { ForwardNodePayload } from '../events';
import type { PacketInfo } from '../../protocol/types';
import {