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

Refresh the resulting Realm in GetInstanceAsync #2677

Merged
merged 1 commit into from
Oct 13, 2021
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
### Internal
* Using Core x.y.z.
* iOS wrappers are now built with the "new build system" introduced by Xcode 10 and used as default by Xcode 12. More info can be found in cmake's [docs](https://cmake.org/cmake/help/git-stage/variable/CMAKE_XCODE_BUILD_SYSTEM.html#variable:CMAKE_XCODE_BUILD_SYSTEM).
* We now refresh the resulting Realm instance when opening a synchronized Realm with `GetInstanceAsync`. (Issue [#2256](https://github.com/realm/realm-dotnet/issues/2256))

## 10.6.0 (2021-09-30)

Expand Down
8 changes: 4 additions & 4 deletions wrappers/src/shared_realm_cs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,7 @@ REALM_EXPORT SharedRealm* shared_realm_open_with_sync(Configuration configuratio
auto config = get_shared_realm_config(configuration, sync_configuration, objects, objects_length, properties, encryption_key);

auto realm = Realm::get_shared_realm(config);
if (!configuration.read_only)
realm->refresh();

realm->refresh();
return new SharedRealm(realm);
});
}
Expand Down Expand Up @@ -399,7 +397,9 @@ REALM_EXPORT void* shared_realm_resolve_reference(SharedRealm& realm, ThreadSafe
REALM_EXPORT SharedRealm* shared_realm_resolve_realm_reference(ThreadSafeReference& reference, NativeException::Marshallable& ex)
{
return handle_errors(ex, [&]() {
return new SharedRealm(Realm::get_shared_realm(std::move(reference)));
auto realm = Realm::get_shared_realm(std::move(reference));
realm->refresh();
return new SharedRealm(realm);
});
}

Expand Down