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';
99import 'package:powersync_core/src/sync/protocol.dart' ;
1010import 'package:test/test.dart' ;
1111
12+ import 'bucket_storage_test.dart' ;
1213import 'server/sync_server/in_memory_sync_server.dart' ;
1314import 'utils/abstract_test_utils.dart' ;
1415import 'utils/in_memory_http.dart' ;
@@ -653,6 +654,23 @@ void main() {
653654 emits (isSyncStatus (downloading: false , downloadProgress: isNull)));
654655 });
655656 });
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+ });
656674 });
657675}
658676
You can’t perform that action at this time.
0 commit comments