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

RDART-1066: Make schema mode for synchronized realms explicit #1748

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

nirinchev
Copy link
Member

Change schema mode to additive explicit. When schema mode is .discovered, orphaned embedded objects are ignored, which causes a "no such table" exception to be called when we try to look up the table metadata.

Related to #1740, but unlikely to have fixed it.

@@ -86,7 +86,7 @@ class ConfigHandle extends HandleBase<realm_config> {
} else if (config is InMemoryConfiguration) {
realmLib.realm_config_set_in_memory(configHandle.pointer, true);
} else if (config is FlexibleSyncConfiguration) {
realmLib.realm_config_set_schema_mode(configHandle.pointer, realm_schema_mode.RLM_SCHEMA_MODE_ADDITIVE_DISCOVERED);
realmLib.realm_config_set_schema_mode(configHandle.pointer, realm_schema_mode.RLM_SCHEMA_MODE_ADDITIVE_EXPLICIT);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual change, the rest is just cleanup of test code that I noticed while running the tests locally.

Comment on lines +1961 to +1966
test('Local realm can be opened with orphaned embedded objects', () {
final config = Configuration.local([Car.schema, AllTypesEmbedded.schema], path: generateRandomRealmPath());
expect(() => getRealm(config), returnsNormally);
});

baasTest('Sync realm with orphaned embedded objects, throws', (appConfig) async {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the tests that test the new changes

@nirinchev nirinchev merged commit 28e0e5a into main Jul 29, 2024
57 of 59 checks passed
@nirinchev nirinchev deleted the ni/explicit-schema-mode branch July 29, 2024 06:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant