docs(chat): consolidate multi-role protocol

This commit is contained in:
2026-07-20 19:08:24 +08:00
parent edf50e9cc4
commit 9f176272c1
12 changed files with 276 additions and 1117 deletions
+2 -2
View File
@@ -103,7 +103,7 @@ export class ChatRepository implements IChatRepository {
/**
* 批量覆盖写入:先清空本地存储,再写入新列表。
* 保留 Dart 端的「先清后写」语义(用于同步场景的整批刷新
* 用于网络历史同步后的整批刷新。
*/
async saveMessagesToLocal(
messages: readonly ChatMessage[],
@@ -126,7 +126,7 @@ export class ChatRepository implements IChatRepository {
/**
* 获取本地消息数量。
* 替代 Dart 的同步 `int get localMessageCount`——Dexie 异步 API 决定必须 async
* Dexie 查询是异步操作,因此始终返回 Promise
*/
async getLocalMessageCount(cacheIdentity?: string): Promise<Result<number>> {
return this.localMessages.getMessageCount(cacheIdentity);