♻️ Coalesce realtime changes and stay quiet offline
Every PocketBase event ran its own full sync of the collection, with rejections nobody caught and around beforeSync and onSyncRound. A remote change now starts a round through syncNow(), at most one per 300 ms window; one that lands while a round runs gets its own round after it. The debounced local push is unchanged. A failed pull or push no longer sets the sync error while the browser is offline, since the layout shows "Offline" then. A failed round reports the distinct errors of its syncs on one line instead of the heading syncAll() puts above them.
This commit is contained in:
@@ -29,6 +29,7 @@ const mocks = vi.hoisted(() => {
|
||||
});
|
||||
|
||||
vi.mock('$lib/pb', () => ({
|
||||
errorMessage: (e: unknown) => (e instanceof Error ? e.message : String(e)),
|
||||
pb: {
|
||||
authStore: { isValid: true },
|
||||
autoCancellation: () => undefined,
|
||||
|
||||
Reference in New Issue
Block a user