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:
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', () => {
|
||||
|
||||
Reference in new issue
Block a user