refactor(protocol): move roster refresh into the packet pipeline

Replace the shallow refreshMemberCache adapter with fetchGroupList
and fetchGroupMemberList ports. Skip, swallow, and coalesce stay
next to the join/leave/admin trigger.
This commit is contained in:
DrSmoothl committed 2026-08-16 23:18:04 +08:00
1 parent 9772d4f0bf
commit 206727f823
7 files changed
+265 -44

No files matched your search

@@ -37,7 +37,8 @@ function makePipeline(opts: {
const pipeline = new IncomingPacketPipeline({
identity,
events,
refreshMemberCache: vi.fn(async () => false),
fetchGroupList: vi.fn(async () => {}),
fetchGroupMemberList: vi.fn(async () => {}),
resolveGroupJoinRequest,
resolveGroupInviteCardSequence,
});
@@ -387,7 +388,8 @@ describe('IncomingPacketPipeline / #1 group card self-heal', () => {
const pipeline = new IncomingPacketPipeline({
identity,
events,
refreshMemberCache: vi.fn(async () => false),
fetchGroupList: vi.fn(async () => {}),
fetchGroupMemberList: vi.fn(async () => {}),
resolveGroupJoinRequest: vi.fn(async () => null),
});
return { identity, pipeline };
@@ -452,7 +454,8 @@ describe('IncomingPacketPipeline / group_card_change from message traffic', () =
const events = new BridgeEventBus();
const pipeline = new IncomingPacketPipeline({
identity, events,
refreshMemberCache: vi.fn(async () => false),
fetchGroupList: vi.fn(async () => {}),
fetchGroupMemberList: vi.fn(async () => {}),
resolveGroupJoinRequest: vi.fn(async () => null),
});
const captured: QQEventVariant[] = [];
@@ -519,7 +522,8 @@ describe('IncomingPacketPipeline / invite-card pending application', () => {
const pipeline = new IncomingPacketPipeline({
identity: IdentityService.memory('10001'),
events: new BridgeEventBus(),
refreshMemberCache: vi.fn(async () => false),
fetchGroupList: vi.fn(async () => {}),
fetchGroupMemberList: vi.fn(async () => {}),
resolveGroupJoinRequest: vi.fn(async () => null),
rememberGroupInviteCardSequence,
});