File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
packages/powersync_core/test Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import 'package:powersync_core/src/sync/streaming_sync.dart';
9
9
import 'package:powersync_core/src/sync/protocol.dart' ;
10
10
import 'package:test/test.dart' ;
11
11
12
+ import 'bucket_storage_test.dart' ;
12
13
import 'server/sync_server/in_memory_sync_server.dart' ;
13
14
import 'utils/abstract_test_utils.dart' ;
14
15
import 'utils/in_memory_http.dart' ;
@@ -653,6 +654,23 @@ void main() {
653
654
emits (isSyncStatus (downloading: false , downloadProgress: isNull)));
654
655
});
655
656
});
657
+
658
+ test ('stopping closes connections' , () async {
659
+ final status = await waitForConnection ();
660
+
661
+ syncService.addLine ({
662
+ 'checkpoint' : Checkpoint (
663
+ lastOpId: '4' ,
664
+ writeCheckpoint: null ,
665
+ checksums: [checksum (bucket: 'a' , checksum: 0 )],
666
+ )
667
+ });
668
+
669
+ await expectLater (status, emits (isSyncStatus (downloading: true )));
670
+ await syncClient.abort ();
671
+
672
+ expect (syncService.controller.hasListener, isFalse);
673
+ });
656
674
});
657
675
}
658
676
You can’t perform that action at this time.
0 commit comments