fix(protocol): preserve private voice playback on older clients

Keep private voice messages playable on older clients while retaining the existing voice message for current clients. Cover the reported upload response in a regression test.

Refs #614
This commit is contained in:
DrSmoothl committed 2026-10-31 18:28:05 +08:00
1 parent eb119ecb92
commit a557bf72e7
11 files changed
+223 -39

No files matched your search

@@ -2,7 +2,11 @@ import { describe, expect, it, vi } from 'vitest';
import { protobuf_decode, protobuf_encode } from '@snowluma/proton';
import type { SendPacketResult } from '@snowluma/common/packet-sender';
import type { DatalineMsgBody, DatalineTextMsg } from '@snowluma/proto-defs/dataline';
import type { SendMessageRequest, SendMessageResponse } from '@snowluma/proto-defs/action';
import type {
SendMessageRequest,
SendMessageResponse,
SendRichText,
} from '@snowluma/proto-defs/action';
import type { FileExtra } from '@snowluma/proto-defs/message';
import { DATALINE_UIN_PHONE } from '@snowluma/protocol/dataline/device-contacts';
import type { OidbBase } from '@snowluma/proto-defs/oidb';
@@ -10,6 +14,9 @@ import type { OidbOfflineFileFinalizeResp } from '@snowluma/proto-defs/oidb-acti
vi.mock('@snowluma/protocol/element-builder', () => ({
buildSendElems: vi.fn(async () => [{ text: { str: 'stub media elem' } }]),
encodePrivateRichText: vi.fn(async () =>
protobuf_encode<SendRichText>({ elems: [{ text: { str: 'stub media elem' } }] }),
),
}));
// Imported statically (not via `await import` inside each `it`) so the heavy