Skip to content

Commit

Permalink
Use syncSchema for flexibleSync
Browse files Browse the repository at this point in the history
  • Loading branch information
desistefanova committed Sep 14, 2023
1 parent 10ccf15 commit 4753317
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions test/client_reset_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,34 @@ Future<void> main([List<String>? args]) async {
expect(
Configuration.flexibleSync(
user,
[Task.schema, Schedule.schema],
syncSchema,
clientResetHandler: ManualRecoveryHandler((syncError) {}),
).clientResetHandler.clientResyncMode,
ClientResyncModeInternal.manual);
expect(
Configuration.flexibleSync(
user,
[Task.schema, Schedule.schema],
syncSchema,
clientResetHandler: const DiscardUnsyncedChangesHandler(),
).clientResetHandler.clientResyncMode,
ClientResyncModeInternal.discardLocal);
expect(
Configuration.flexibleSync(
user,
[Task.schema, Schedule.schema],
syncSchema,
clientResetHandler: const RecoverUnsyncedChangesHandler(),
).clientResetHandler.clientResyncMode,
ClientResyncModeInternal.recover);

expect(
Configuration.flexibleSync(
user,
[Task.schema, Schedule.schema],
syncSchema,
clientResetHandler: const RecoverOrDiscardUnsyncedChangesHandler(),
).clientResetHandler.clientResyncMode,
ClientResyncModeInternal.recoverOrDiscard);

expect(Configuration.flexibleSync(user, [Task.schema, Schedule.schema]).clientResetHandler.clientResyncMode, ClientResyncModeInternal.recoverOrDiscard);
expect(Configuration.flexibleSync(user, syncSchema).clientResetHandler.clientResyncMode, ClientResyncModeInternal.recoverOrDiscard);
});

baasTest('ManualRecoveryHandler error is reported in callback', (appConfig) async {
Expand Down
2 changes: 1 addition & 1 deletion test/configuration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ Future<void> main([List<String>? args]) async {

List<int> key = List<int>.generate(encryptionKeySize + 10, (i) => random.nextInt(256));
expect(
() => Configuration.flexibleSync(user, [Task.schema], encryptionKey: key),
() => Configuration.flexibleSync(user, syncSchema, encryptionKey: key),
throws<RealmException>("Wrong encryption key size"),
);
});
Expand Down
4 changes: 2 additions & 2 deletions test/realm_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ Future<void> main([List<String>? args]) async {
final realm = getRealm(configuration);
expect(realm.isClosed, false);
expect(
() => getRealm(Configuration.flexibleSync(user, [Task.schema])),
() => getRealm(Configuration.flexibleSync(user, syncSchema)),
throws<RealmException>("already opened with a different encryption key"),
);
});
Expand Down Expand Up @@ -1737,7 +1737,7 @@ Future<void> main([List<String>? args]) async {

// Create another user's realm and download the data
var anotherUser = await app.logIn(Credentials.anonymous(reuseCredentials: false));
final anotherUserRealm = getRealm(Configuration.flexibleSync(anotherUser, [Product.schema]));
final anotherUserRealm = getRealm(Configuration.flexibleSync(anotherUser, syncSchema));
await _addSubscriptions(anotherUserRealm, productNamePrefix);
await anotherUserRealm.syncSession.waitForUpload();
await anotherUserRealm.syncSession.waitForDownload();
Expand Down
4 changes: 2 additions & 2 deletions test/subscription_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ Future<void> main([List<String>? args]) async {
final userX = await appX.logIn(credentials);
final userY = await appY.logIn(credentials);

final realmX = getRealm(Configuration.flexibleSync(userX, [Task.schema]));
final realmY = getRealm(Configuration.flexibleSync(userY, [Task.schema]));
final realmX = getRealm(Configuration.flexibleSync(userX, syncSchema));
final realmY = getRealm(Configuration.flexibleSync(userY, syncSchema));

realmX.subscriptions.update((mutableSubscriptions) {
mutableSubscriptions.add(realmX.all<Task>());
Expand Down

0 comments on commit 4753317

Please sign in to comment.