refactor(protocol): resolve like-list UINs through Identity

GetLike already filled cached UINs in deserialize. ProfileApi then
opened a second Contacts hop and threw on fetch failure.

Misses now go through Identity.resolveUin after invokeOidb, coalesced
by uid. ProfileApi.getLike is invoke-only. Unresolved rows stay
uin=0 and no longer fail the action.
This commit is contained in:
DrSmoothl committed 2026-08-16 19:23:44 +08:00
1 parent 226b48fd7a
commit 23352dcad4
5 files changed
+89 -48

No files matched your search

+2
View File
@@ -127,6 +127,7 @@ export interface MockBridge {
nickname: string;
findUidByUin: ReturnType<typeof vi.fn>;
findUinByUid: ReturnType<typeof vi.fn>;
resolveUin: ReturnType<typeof vi.fn>;
findGroupMember: ReturnType<typeof vi.fn>;
updateFriendRemark: ReturnType<typeof vi.fn>;
updateGroupRemark: ReturnType<typeof vi.fn>;
@@ -161,6 +162,7 @@ export function mockBridge(overrides: Partial<MockBridge> = {}): MockBridge {
nickname: 'self-nick',
findUidByUin: vi.fn(() => 'cached-uid'),
findUinByUid: vi.fn(() => 0),
resolveUin: vi.fn(async () => null),
findGroupMember: vi.fn(() => null),
updateFriendRemark: vi.fn(() => true),
updateGroupRemark: vi.fn(() => true),