You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if this flag is set to true, pullChanges is expected to be an
AsyncGenerator that yields multiple SyncPullResults pullChanges is
expected to be an AsyncGenerator that yields multiple SyncPullResults.
'[Sync] Concurrent synchronization is not allowed. More than one synchronize() call was running at the same time, and the later one was aborted before committing results to local database.',
'unsafeTurbo must not be used with _unsafeBatchPerCollection',
70
+
lastPulledAt===(awaitgetLastPulledAt(database)),
71
+
'[Sync] Concurrent synchronization is not allowed. More than one synchronize() call was running at the same time, and the later one was aborted before committing results to local database.',
74
72
)
73
+
74
+
if(unsafeTurbo){
75
+
invariant(
76
+
!_unsafeBatchPerCollection,
77
+
'unsafeTurbo must not be used with _unsafeBatchPerCollection',
78
+
)
79
+
invariant(
80
+
'syncJson'inpullResult||'syncJsonId'inpullResult,
81
+
'missing syncJson/syncJsonId',
82
+
)
83
+
invariant(lastPulledAt===null,'unsafeTurbo can only be used as the first sync')
// If this flag is set to true, then pullChanges is expected to return an async generator that yields multiple SyncPullResults. This allows WatermelonDB to process incoming sync data in chunks, which can be useful for syncs that end up being particularly large and might otherwise cause an OOM if held in memory all at once. It is not recommended to use this flag unless you are sure - should a sync fail midway through, the database will be in a "partially synced" and potentially inconsistent state. Although it will eventually become consistent after a subsequent sync is completed, it might cause unexpected issues depending on your particular use case.
0 commit comments