This commit is contained in:
Andras Schmelczer 2026-04-25 21:59:32 +01:00
parent a5b3cc5f3a
commit d23750f15b
6 changed files with 90 additions and 17 deletions

View file

@ -154,6 +154,17 @@ export class Syncer {
public reset(): void {
this.queue.clearPending();
this.clearOfflineScanGate();
}
/**
* Reset the "have we already scanned this session" gate so a later
* `scheduleSyncForOfflineChanges()` actually performs a fresh scan
* instead of returning the previous (resolved) promise. Called when
* sync is paused so the next start picks up any offline edits made
* while sync was off.
*/
public clearOfflineScanGate(): void {
const current = this.runningScheduleSyncForOfflineChanges;
if (current !== undefined) {
void current.finally(() => {