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

Update to latest Core #3334

Merged
merged 2 commits into from
May 31, 2023
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
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@

### Enhancements
* Deprecate the `Realm.SourceGenerator` and `Realm.Fody` packages. The source generation and weaver assemblies are now contained in the main `Realm` package. This should be a transparent change for users who only referenced the `Realm` package, but if you explicitly added a package reference to `Realm.SourceGenerator` or `Realm.Fody`, you should remove it. (PR [#3319](https://github.com/realm/realm-dotnet/pull/3319))
* New notifiers can now be registered in write transactions until changes have actually been made in the write transaction. This makes it so that new notifications can be registered inside change notifications triggered by beginning a write transaction (unless a previous callback performed writes). (Core 13.10.1)
* Partition-Based to Flexible Sync Migration for migrating a client app that uses partition based sync to use flexible sync under the hood if the server has been migrated to flexible sync is officially supported with this release. Any clients using an older version of Realm (including the original support released in Core 11.0.0) will receive a "switch to flexible sync" error message when trying to sync with the app. (Core 13.11.0)
* Support sort/distinct based on values from a dictionary e.g. `.Filter("TRUEPREDICATE SORT(meta['age'])")`. (Core 13.14.0)

### Fixed
* None
* Fixed a fatal error (reported to the sync error handler) during client reset (or automatic PBS to FLX migration) if the reset has been triggered during an async open and the schema being applied has added new classes. (Core 13.11.0)
* Full text search would sometimes find words where the word only matches the beginning of the search token. (Core 13.11.0)
* We could crash when removing backlinks in cases where forward links did not have a corresponding backlink due to corruption. We now silently ignore this inconsistency in release builds, allowing the app to continue. (Core 13.12.0)
* `IDictionary<string, IRealmObject?>` would expose unresolved links rather than mapping them to null. In addition to allowing invalid objects to be read from Dictionaries, this resulted in queries on Dictionaries sometimes having incorrect results. (Core 13.12.0)
* Access token refresh for websockets was not updating the location metadata. (Core 13.13.0)
* Using both synchronous and asynchronous transactions on the same thread or scheduler could hit the assertion failure "!realm.is_in_transaction()" if one of the callbacks for an asynchronous transaction happened to be scheduled during a synchronous transaction. (Core 13.13.0)
* Fixed a potential crash when opening the realm after failing to download a fresh FLX realm during an automatic client reset. (Core 13.14.0)

### Compatibility
* Realm Studio: 13.0.0 or later.
Expand Down
4 changes: 0 additions & 4 deletions Realm/Realm/Handles/AppHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public static extern IntPtr initialize(
[MarshalAs(UnmanagedType.LPWStr)] string framework_version, IntPtr framework_version_len,
[MarshalAs(UnmanagedType.LPWStr)] string sdk_version, IntPtr sdk_version_len,
[MarshalAs(UnmanagedType.LPWStr)] string platform_version, IntPtr platform_version_len,
[MarshalAs(UnmanagedType.LPWStr)] string cpu_arch, IntPtr cpu_arch_len,
[MarshalAs(UnmanagedType.LPWStr)] string device_name, IntPtr device_name_len,
[MarshalAs(UnmanagedType.LPWStr)] string device_version, IntPtr device_version_len,
UserCallback user_callback, VoidTaskCallback void_callback, StringCallback string_callback, ApiKeysCallback api_keys_callback);
Expand Down Expand Up @@ -171,8 +170,6 @@ public static void Initialize()
platformVersion += $" {Environment.OSVersion.ServicePack}";
}

var cpuArch = RuntimeInformation.ProcessArchitecture.ToString();

// TODO: try and infer device information as part of RNET-849
var deviceName = "unknown";
var deviceVersion = "unknown";
Expand All @@ -182,7 +179,6 @@ public static void Initialize()
frameworkVersion, frameworkVersion.IntPtrLength(),
sdkVersion, sdkVersion.IntPtrLength(),
platformVersion, platformVersion.IntPtrLength(),
cpuArch, cpuArch.IntPtrLength(),
deviceName, deviceName.IntPtrLength(),
deviceVersion, deviceVersion.IntPtrLength(),
userLogin, taskCallback, stringCallback, apiKeysCallback);
Expand Down
15 changes: 14 additions & 1 deletion wrappers/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,17 @@ case $i in
esac
done

REALM_CMAKE_SUBPLATFORM="Linux-$libc/$ARCH" bash "$SCRIPT_DIRECTORY"/build.sh -c=$REALM_CMAKE_CONFIGURATION -DCMAKE_TOOLCHAIN_FILE="$SCRIPT_DIRECTORY/realm-core/tools/cmake/$ARCH.toolchain.cmake" -GNinja $EXTRA_CMAKE_ARGS
TOOLCHAIN_FILE=""
case $ARCH in
"x86_64")
TOOLCHAIN_FILE="x86_64-linux-gnu"
;;
"armhf")
TOOLCHAIN_FILE="armv7-linux-gnueabihf"
;;
"aarch64")
TOOLCHAIN_FILE="aarch64-linux-gnu"
;;
esac

REALM_CMAKE_SUBPLATFORM="Linux-$libc/$ARCH" bash "$SCRIPT_DIRECTORY"/build.sh -c=$REALM_CMAKE_CONFIGURATION -DCMAKE_TOOLCHAIN_FILE="$SCRIPT_DIRECTORY/realm-core/tools/cmake/$TOOLCHAIN_FILE.toolchain.cmake" -GNinja $EXTRA_CMAKE_ARGS
2 changes: 1 addition & 1 deletion wrappers/realm-core
Submodule realm-core updated 230 files
20 changes: 0 additions & 20 deletions wrappers/src/app_cs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ namespace realm {
std::string s_framework;
std::string s_framework_version;
std::string s_sdk_version;
std::string s_platform;
std::string s_platform_version;
std::string s_cpu_arch;
std::string s_device_name;
std::string s_device_version;

Expand Down Expand Up @@ -103,7 +101,6 @@ extern "C" {
uint16_t* framework_version, size_t framework_version_len,
uint16_t* sdk_version, size_t sdk_version_len,
uint16_t* platform_version, size_t platform_version_len,
uint16_t* cpu_arch, size_t cpu_arch_len,
uint16_t* device_name, size_t device_name_len,
uint16_t* device_version, size_t device_version_len,
UserCallbackT* user_callback,
Expand All @@ -115,24 +112,9 @@ extern "C" {
s_framework_version = Utf16StringAccessor(framework_version, framework_version_len);
s_sdk_version = Utf16StringAccessor(sdk_version, sdk_version_len);
s_platform_version = Utf16StringAccessor(platform_version, platform_version_len);
s_cpu_arch = Utf16StringAccessor(cpu_arch, cpu_arch_len);
s_device_name = Utf16StringAccessor(device_name, device_name_len);
s_device_version = Utf16StringAccessor(device_version, device_version_len);

#if REALM_ANDROID
s_platform = "Android";
#elif REALM_WINDOWS
s_platform = "Windows";
#elif REALM_UWP
s_platform = "UWP";
#elif REALM_IOS
s_platform = "iOS";
#elif REALM_PLATFORM_APPLE
s_platform = "macOS";
#else
s_platform = "Linux";
#endif

s_user_callback = wrap_managed_callback(user_callback);
s_void_callback = wrap_managed_callback(void_callback);
s_string_callback = wrap_managed_callback(string_callback);
Expand All @@ -151,9 +133,7 @@ extern "C" {
config.device_info.framework_version = s_framework_version;
config.device_info.sdk_version = s_sdk_version;
config.device_info.sdk = "Dotnet";
config.device_info.platform = s_platform;
config.device_info.platform_version = s_platform_version;
config.device_info.cpu_arch = s_cpu_arch;
config.device_info.device_name = s_device_name;
config.device_info.device_version = s_device_version;

Expand Down
2 changes: 1 addition & 1 deletion wrappers/src/sort_descriptor_cs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ REALM_EXPORT void sort_descriptor_destroy(DescriptorOrdering* descriptor)
REALM_EXPORT void sort_descriptor_add_clause(DescriptorOrdering& descriptor, TableKey table_key, SharedRealm& realm, size_t* property_chain, size_t properties_count, bool ascending, bool replacing, NativeException::Marshallable& ex)
{
handle_errors(ex, [&]() {
std::vector<ColKey> column_keys;
std::vector<ExtendedColumnKey> column_keys;
column_keys.reserve(properties_count);

const std::vector<Property>* properties = &realm->schema().find(table_key)->persisted_properties;
Expand Down