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(
363363 Set <String > updatedTables = {};
364364
365365 void maybeFireUpdates () {
366- if (updatedTables.isNotEmpty) {
366+ // Only fire updates when we're not in a transaction
367+ if (updatedTables.isNotEmpty && db? .autocommit == true ) {
367368 upstreamDbClient.fire (UpdateNotification (updatedTables));
368369 updatedTables.clear ();
369370 updateDebouncer? .cancel ();
@@ -375,7 +376,7 @@ Future<void> _powerSyncDatabaseIsolate(
375376 updatedTables.add (event.tableName);
376377
377378 updateDebouncer ?? =
378- Timer (const Duration (milliseconds: 10 ), maybeFireUpdates);
379+ Timer (const Duration (milliseconds: 1 ), maybeFireUpdates);
379380 });
380381 }, (error, stack) {
381382 // Properly dispose the database if an uncaught error occurs.
You can’t perform that action at this time.
0 commit comments