fix(protocol): preserve member operation high bits

Clear only the membership flag bit when normalizing group increase operation codes so unrelated high bits cannot collapse into the invitation value.

Add regression coverage for extended operation codes.
This commit is contained in:
DrSmoothl committed 2026-07-16 20:17:38 +08:00
1 parent 0e3bbc6906
commit c2d028af2e
2 files changed
+17 -5

No files matched your search

@@ -181,9 +181,20 @@ describe('parseMsgPush group member increase', () => {
),
identity,
) as GroupMemberJoin[];
const [unknownHighBits] = parseMsgPush(
makeGroupIncreasePacket(
member.uid,
operator.uid,
GROUP_ID,
Buffer.from(operator.uid, 'utf8'),
0x103,
),
identity,
) as GroupMemberJoin[];
expect(approved.joinType).toBe('approve');
expect(invited.joinType).toBe('invite');
expect(unknownHighBits.joinType).toBe('approve');
});
it('reports malformed raw operator bytes with bounded context', () => {