docs(chat): consolidate multi-role protocol
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user