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

+4 -4
View File
@@ -370,7 +370,7 @@ export const actions = [
return failedResponse(RETCODE.BAD_REQUEST, 'group_id does not match message session');
}
await ctx.bridge.apis.message.markGroupRead(meta.targetId, meta.sequence);
await ctx.bridge.apis.message.markGroupRead(meta.targetId);
return okResponse();
},
}),
@@ -392,7 +392,7 @@ export const actions = [
return failedResponse(RETCODE.BAD_REQUEST, 'user_id does not match message session');
}
await ctx.bridge.apis.message.markPrivateRead(meta.targetId, meta.sequence);
await ctx.bridge.apis.message.markPrivateRead(meta.targetId);
return okResponse();
},
}),
@@ -413,9 +413,9 @@ export const actions = [
}
if (meta.isGroup) {
await ctx.bridge.apis.message.markGroupRead(meta.targetId, meta.sequence);
await ctx.bridge.apis.message.markGroupRead(meta.targetId);
} else {
await ctx.bridge.apis.message.markPrivateRead(meta.targetId, meta.sequence);
await ctx.bridge.apis.message.markPrivateRead(meta.targetId);
}
return okResponse();
},