refactor(sync): replace message reloads with incremental tail sync

This commit is contained in:
weishu
2026-07-28 12:20:53 +08:00
parent 2235b924a7
commit faf70c64dd
28 changed files with 2927 additions and 2077 deletions
+20
View File
@@ -283,6 +283,11 @@ export class ApiClient {
options: {
beforeSeq?: number | null
beforeAt?: number | null
afterSeq?: number | null
afterAt?: number | null
untilSeq?: number | null
untilAt?: number | null
epoch?: number | null
limit?: number
}
): Promise<MessagesResponse> {
@@ -293,6 +298,21 @@ export class ApiClient {
if (options.beforeSeq !== undefined && options.beforeSeq !== null) {
params.set('beforeSeq', `${options.beforeSeq}`)
}
if (options.afterAt !== undefined && options.afterAt !== null) {
params.set('afterAt', `${options.afterAt}`)
}
if (options.afterSeq !== undefined && options.afterSeq !== null) {
params.set('afterSeq', `${options.afterSeq}`)
}
if (options.untilAt !== undefined && options.untilAt !== null) {
params.set('untilAt', `${options.untilAt}`)
}
if (options.untilSeq !== undefined && options.untilSeq !== null) {
params.set('untilSeq', `${options.untilSeq}`)
}
if (options.epoch !== undefined && options.epoch !== null) {
params.set('epoch', `${options.epoch}`)
}
if (options.limit !== undefined && options.limit !== null) {
params.set('limit', `${options.limit}`)
}