fix: 更新打包配置并修复群昵称刷新

更新跨平台 WCDB 和运行时命名。
优化消息获取速度
修复群昵称刷新回退与消息发送者显示,并增加可控的消息读取诊断日志和有界查询优化。
This commit is contained in:
Wxw-Gu
2026-08-25 14:26:29 +08:00
committed by 电摇小子
parent fc54c3b946
commit 47e0d7cd1e
25 changed files with 415 additions and 148 deletions
+31
View File
@@ -110,4 +110,35 @@ describe('WCDB group member names', () => {
expectedMember({ nickname: '真实群昵称', wechatNickname: '', remark: '' })
])
})
it('uses the group nickname for message sender display before contact display names', () => {
const client = Object.assign(Object.create(Wcdb4Client.prototype), {
accountRoot: '/fixture/account',
displayNameCache: new Map([['wxid-member', '通讯录昵称']]),
getGroupNicknames: vi.fn(() => new Map([['wxid-member', '真实群昵称']])),
avatarCache: new Map<string, string>(),
myWxid: '',
wxid: ''
}) as Wcdb4Client
const finalizeMessages = (client as unknown as {
finalizeMessages: (
username: string,
rows: Record<string, unknown>[]
) => Array<{ senderNickname?: string }>
}).finalizeMessages
expect(
finalizeMessages.call(client, 'fixture@chatroom', [
{
sender_username: 'wxid-member',
create_time: 1731327263,
local_id: 1,
local_type: 1,
msg_content: 'fixture'
}
])
).toMatchObject([{ senderNickname: '真实群昵称' }])
expect(client.getGroupNicknames).toHaveBeenCalledWith('fixture@chatroom')
})
})