From e3753f34d8a456903a6601b8bd28e54aab24eb16 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:39:03 +0000 Subject: [PATCH] Add vNext Changelog header (#1717) Co-authored-by: nielsenko --- CHANGELOG.md | 14 ++++++++++++++ packages/realm_dart/test/app_test.dart | 16 ++++++++++++++++ packages/realm_dart/test/test.dart | 4 ++-- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab6831cc0..c3d2a41f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## vNext (TBD) + +### Enhancements +* None + +### Fixed +* None + +### Compatibility +* Realm Studio: 15.0.0 or later. + +### Internal +* Using Core x.y.z. + ## 3.0.0 (2024-06-07) ### Breaking Changes diff --git a/packages/realm_dart/test/app_test.dart b/packages/realm_dart/test/app_test.dart index 13f758250..9d3bc10ab 100644 --- a/packages/realm_dart/test/app_test.dart +++ b/packages/realm_dart/test/app_test.dart @@ -8,6 +8,7 @@ import 'package:crypto/crypto.dart'; import 'package:http/http.dart'; import 'package:path/path.dart' as path; import 'package:realm_dart/realm.dart'; +import 'package:realm_dart/src/configuration.dart'; import 'package:realm_dart/src/handles/realm_core.dart'; import 'test.dart'; @@ -379,6 +380,21 @@ void main() { expect(log, contains('App constructor called on Isolate')); }); + baasTest('boom', (appConfig) async { + final appId = appConfig.appId; + final url = appConfig.baseUrl; + for (var i = 0; i < 5; i++) { + await Isolate.run(() async { + clearCachedApps(); // simulate first time on main isolate + final app = App(AppConfiguration(appId, baseUrl: url)); + final user = await app.logIn(Credentials.anonymous()); + final config = Configuration.flexibleSync(user, getSyncSchema()); + final realm = getRealm(config, stopPolicy: SessionStopPolicy.afterChangesUploaded); + realm.close(); + }); + } + }); + test('AppConfiguration(empty-id) throws', () { expect(() => AppConfiguration(''), throwsA(isA())); }); diff --git a/packages/realm_dart/test/test.dart b/packages/realm_dart/test/test.dart index ff0432f26..facda6296 100644 --- a/packages/realm_dart/test/test.dart +++ b/packages/realm_dart/test/test.dart @@ -485,9 +485,9 @@ String generateRandomEmail({int length = 5}) { return "$randomString@realm.io"; } -Realm getRealm(Configuration config) { +Realm getRealm(Configuration config, {SessionStopPolicy stopPolicy = SessionStopPolicy.immediately}) { if (config is FlexibleSyncConfiguration) { - config.sessionStopPolicy = SessionStopPolicy.immediately; + config.sessionStopPolicy = stopPolicy; } final realm = Realm(config);