fix(core): verify conversation read updates

Replace message-header sequence forwarding with a server-guided read flow for group and private conversations.

Batch read reports conservatively, validate per-conversation results and cursor advancement, and fail with actionable errors when the server does not apply an update.

Add regression coverage for mixed batches, pagination, already-current sessions, malformed responses, and private sequence-domain mismatches.
This commit is contained in:
DrSmoothl committed 2026-07-13 23:01:39 +08:00
1 parent 6f484e06e6
commit 03aec3b052
5 files changed
+456 -51

No files matched your search

+2
View File
@@ -27,6 +27,7 @@ export interface MockMessageApi {
recallPrivate: ReturnType<typeof vi.fn>;
markGroupRead: ReturnType<typeof vi.fn>;
markPrivateRead: ReturnType<typeof vi.fn>;
markAllRead: ReturnType<typeof vi.fn>;
}
export function mockMessageApi(): MockMessageApi {
@@ -38,6 +39,7 @@ export function mockMessageApi(): MockMessageApi {
recallPrivate: vi.fn(async () => undefined),
markGroupRead: vi.fn(async () => undefined),
markPrivateRead: vi.fn(async () => undefined),
markAllRead: vi.fn(async () => undefined),
};
}