File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/powersync/lib/src/database/native Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -363,7 +363,8 @@ Future<void> _powerSyncDatabaseIsolate(
363
363
Set <String > updatedTables = {};
364
364
365
365
void maybeFireUpdates () {
366
- if (updatedTables.isNotEmpty) {
366
+ // Only fire updates when we're not in a transaction
367
+ if (updatedTables.isNotEmpty && db? .autocommit == true ) {
367
368
upstreamDbClient.fire (UpdateNotification (updatedTables));
368
369
updatedTables.clear ();
369
370
updateDebouncer? .cancel ();
@@ -375,7 +376,7 @@ Future<void> _powerSyncDatabaseIsolate(
375
376
updatedTables.add (event.tableName);
376
377
377
378
updateDebouncer ?? =
378
- Timer (const Duration (milliseconds: 10 ), maybeFireUpdates);
379
+ Timer (const Duration (milliseconds: 1 ), maybeFireUpdates);
379
380
});
380
381
}, (error, stack) {
381
382
// Properly dispose the database if an uncaught error occurs.
You can’t perform that action at this time.
0 commit comments