Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to reproduce #1721

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 16 additions & 0 deletions packages/realm_dart/test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<RealmException>()));
});
Expand Down
4 changes: 2 additions & 2 deletions packages/realm_dart/test/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,9 @@ String generateRandomEmail({int length = 5}) {
return "[email protected]";
}

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);
Expand Down
Loading