Skip to content

Commit 5e12a07

Browse files
fix: should be reset after has been called
1 parent 5123578 commit 5e12a07

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/powersync/lib/src/database/powersync_db_mixin.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ mixin PowerSyncDatabaseMixin implements SqliteConnection {
239239
await tx.execute('DELETE FROM ${quoteIdentifier(row['name'])}');
240240
}
241241
});
242+
// The data has been deleted - reset these
243+
setStatus(SyncStatus(lastSyncedAt: null, hasSynced: false));
242244
}
243245

244246
@Deprecated('Use [disconnectAndClear] instead.')

packages/powersync/lib/src/streaming_sync.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:async';
22
import 'dart:convert' as convert;
3+
34
import 'package:http/http.dart' as http;
45
import 'package:powersync/src/abort_controller.dart';
56
import 'package:powersync/src/exceptions.dart';
@@ -143,6 +144,9 @@ class StreamingSyncImplementation {
143144
await uploadAllCrud();
144145

145146
await for (var _ in updateStream) {
147+
if (_abort?.aborted == true) {
148+
break;
149+
}
146150
await uploadAllCrud();
147151
}
148152
}

0 commit comments

Comments
 (0)