diff --git a/frontend/src/lib/itemStore.svelte.ts b/frontend/src/lib/itemStore.svelte.ts index 11f37305ab..3753db7c87 100644 --- a/frontend/src/lib/itemStore.svelte.ts +++ b/frontend/src/lib/itemStore.svelte.ts @@ -88,7 +88,8 @@ export type ItemRowPort = { /** Send what `write` queued for `key` now; resolves once it landed. */ flush(key: ItemKey): Promise overwrite(key: ItemKey, value: unknown | null): Promise - /** Rows landed for `key` so far, by any writer. Handed back to `seedSync` to order it. */ + /** Rows handed to the syncer for `key` so far, by any writer, counted before the debounce + * rather than on the response. Handed back to `seedSync` to order it. */ rowMark(key: ItemKey): number seedSync(key: ItemKey, draftSavedAt: string | undefined, since: number): void conflicted(key: ItemKey): boolean diff --git a/frontend/src/lib/userDraftDbSyncer.svelte.ts b/frontend/src/lib/userDraftDbSyncer.svelte.ts index 2306b4b336..0af0dcc817 100644 --- a/frontend/src/lib/userDraftDbSyncer.svelte.ts +++ b/frontend/src/lib/userDraftDbSyncer.svelte.ts @@ -538,12 +538,10 @@ export const UserDraftDbSyncer = { }, /** - * Seed the per-tab `last_sync` after an editor reads a draft from the - * server. Pass the response's `draft_saved_at` so the next save sends a - * matching `last_sync`; pass `undefined` when no draft existed (next - * save omits `last_sync`, the backend's first-push branch). Pass the - * `sendsSoFar` taken before the read as `since`: a row handed over after - * that puts the syncer ahead of this response, which is then ignored. + * Seed the per-tab `last_sync` from a read: its `draft_saved_at`, or + * `undefined` when no draft existed (the backend's first-push branch). + * `since` is the `sendsSoFar` taken before that read; a row handed over + * after it leaves this response behind, so it is ignored. */ recordRemoteSync( query: UserDraftLastSyncQuery,