diff --git a/packages/core/src/bridge/apis/interaction.ts b/packages/core/src/bridge/apis/interaction.ts index a77a6086..5d349406 100644 --- a/packages/core/src/bridge/apis/interaction.ts +++ b/packages/core/src/bridge/apis/interaction.ts @@ -87,8 +87,12 @@ export class InteractionApi { const env = makeOidbEnvelope(0x9083, 1, req); const respBytes = await runOidb(bridge, 'OidbSvcTrpcTcp.0x9083_1', protobuf_encode>(env)); const resp = protobuf_decode>(respBytes).body; - const uin = resp?.inner?.userInfo?.uin; - const users = uin ? [{ uin: Number(uin) }] : []; + // userInfo is repeated on the wire — one entry per liker. The pre-fix + // schema treated it as single, which made multi-user responses collapse + // into one and (when paired with the swapped req fields) yield []. + const users: Array<{ uin: number }> = (resp?.inner?.userInfo ?? []) + .map(u => ({ uin: Number(u?.uin ?? 0) })) + .filter(u => u.uin > 0); const respCookie = resp?.cookie ? Buffer.from(resp.cookie).toString('base64') : ''; return { users, cookie: respCookie, isLast: !respCookie }; } diff --git a/packages/core/tests/actions/interaction.test.ts b/packages/core/tests/actions/interaction.test.ts index 7d5705b6..9fb7b0d7 100644 --- a/packages/core/tests/actions/interaction.test.ts +++ b/packages/core/tests/actions/interaction.test.ts @@ -78,13 +78,13 @@ describe('apis/interaction', () => { vi.mocked(oidb.runOidb).mockResolvedValueOnce( protobuf_encode>({ body: { - inner: { userInfo: { uin: 10001n } }, + inner: { userInfo: [{ uin: 10001n }, { uin: 20002n }] }, cookie: new Uint8Array([0xCA, 0xFE]), } as any, }), ); const out = await new InteractionApi(bridge as any).getEmojiLikes(12345, 99, '128516'); - expect(out.users).toEqual([{ uin: 10001 }]); + expect(out.users).toEqual([{ uin: 10001 }, { uin: 20002 }]); expect(out.cookie).toBe(Buffer.from([0xCA, 0xFE]).toString('base64')); expect(out.isLast).toBe(false); }); diff --git a/packages/proto-defs/src/oidb-actions/base.ts b/packages/proto-defs/src/oidb-actions/base.ts index 820da07b..59f85965 100644 --- a/packages/proto-defs/src/oidb-actions/base.ts +++ b/packages/proto-defs/src/oidb-actions/base.ts @@ -512,11 +512,18 @@ export interface FaceroamOpResp { field3?: pb<3, uint_32>; item?: pb<4, FaceroamOpRespItem>; } +// 0x9083_1: fetch emoji-like user list. Field numbers must mirror the +// sibling 0x9082 reaction Req (OidbGroupReaction): field 4 = emoji_id +// (string), field 5 = emoji_type (uint). The pre-fix definition had +// these two swapped, which silently dropped both fields on the server +// side (wire type mismatch → protobuf decoder discards) and made every +// call return an empty list with no error. Cross-checked against +// Lagrange.Core V2 `Internal/Packets/Service/SetGroupReaction.cs`. export interface Oidb0x9083Req { groupId?: pb<2, uint_64>; sequence?: pb<3, uint_32>; - emojiType?: pb<4, uint_32>; - emojiId?: pb<5, string>; + emojiId?: pb<4, string>; + emojiType?: pb<5, uint_32>; cookie?: pb<6, bytes>; field7?: pb<7, uint_32>; count?: pb<8, uint_32>; @@ -527,7 +534,11 @@ export interface Oidb0x9083RespUserInfo { field3?: pb<3, uint_32>; } export interface Oidb0x9083RespInner { - userInfo?: pb<1, Oidb0x9083RespUserInfo>; + // The server returns one entry per liker — must be repeated. A single + // field collapses N wire entries into "last writer wins", so groups + // with multiple likers used to come back as a single user (or empty + // if the wire layout shifted). + userInfo?: pb_repeated<1, Oidb0x9083RespUserInfo>; field4?: pb<4, uint_32>; } export interface Oidb0x9083Resp {