Changelog History
Page 2
-
v10.11.0 Changes
March 28, 2022✨ Enhancements
- ➕ Added property
Session.ConnectionState
to get aSession
'sSessionConnectionState
. Additionally,Session
now implementsINotifyPropertyChanged
so that you can listen for changes onSession.ConnectionState
. (Issue #2801) - 🏁 Realm now supports running on Windows ARM64 for .NET Framework, .NET Core, and UWP apps. (Issues #2704 and #2817)
- ➕ Added a property
AppConfiguration.HttpClientHandler
that allows you to override the default http client handler used by the Realm .NET SDK to make http calls. Note that this only affects the behavior of http calls, such as user login, function calls, and remote mongodb calls. The sync client uses a native websocket implementation and will not use the provided message handler. (Issue #2865)
🛠 Fixed
- 🛠 [Unity] Fixed an issue that caused the weaver to fail when invoked via the
Tools->Realm->Weave Assemblies
editor menu with the errorUnityEngine.UnityException: get_dataPath can only be called from the main thread
. (Issue #2836) - 🛠 Fixed an issue that caused
RealmInvalidObjectException
to be caused when enumerating an invalid Realm collection (e.g. a list belonging to a deleted object). (Issue #2840) - 📜 Query parser would not accept "in" as a property name (Core Issue #5312)
- 🛠 Application would sometimes crash with exceptions like 'KeyNotFound' or assertion "has_refs()". Other issues indicating file corruption may also be fixed by this. The one mentioned here is the one that lead to solving the problem. (Core Issue #5283)
Compatibility
- Realm Studio: 11.0.0 or later.
Internal
- Using Core 11.12.0.
- 🏁 Enabled running Benchmarks on iOS devices by turning on the interpreter for some windows assemblies.
- ➕ Added property
-
v10.10.0 Changes
February 28, 2022Guid representation issue
🚀 This release fixes a major bug in the way Guid values are stored in the database. It provides an automatic migration for local (non-synchronized) databases, but extra caution is needed when upgrading an app that uses Sync.
Context
👀 A Guid is represented by 4 components -
int
,short
,short
, and abyte[8]
. Microsoft's Guids diverge from the UUID spec in that they encode the first three components with the endianness of the system (little-endian for all modern CPUs), while UUIDs encode their components as big-endian. The end result is that the same bytes have a different string representations when interpreted as aGuid
by the .NET SDK vs when interpreted as aUUID
by the Realm Database - e.g.f2952191-a847-41c3-8362-497f92cb7d24
vs912195f2-47a8-c341-8362-497f92cb7d24
(note the swapping of bytes in the first three components). You can see the issue by opening a database created by the .NET SDK in Realm Studio and inspecting the values for Guid properties.🛠 Fix
🔀 The fix we're providing is to adjust the behavior of the .NET SDK to read/write Guids to the database with big-endian representation. This means that the SDK and the database will consistently display the same values. This has some implications which are described in the Local- and Synchronized Realms sections.
Local Realms
⚡️ For local Realms, we're executing a one-time migration the first time the Realm is opened with the new SDK. During this migration, we'll update all Guid fields to big-endian format. This means that their string representation will remain the same, but the value in the database will change to match it. This means that the upgrade process should be seamless, but if you decide to downgrade to an older version of the SDK, you'll see the byte order get flipped. The migration will not execute multiple times, even if you downgrade.
🔀 Synchronized Realms
🔀 There's no client migration provided for synchronized Realms. This is because the distributed nature of the system would mean that there will inevitably be a period of inconsistent state. Instead, the values of the
Guid
properties are read as they're already stored in the database, meaning the string representation will be flipped compared to previous versions of the SDK but it will now match the representation in Atlas/Compass/Realm Studio. There are three general groups your app will fall under:- If you don't care about the string values of Guid properties on the client, then you don't need to do anything. The values will still be unique and valid Guids.
- ⬆️ If you do use the string guid values from the client app - e.g. to correlate user ids with a CMS, but have complete control over your client devices - e.g. because this an internal company app, then it's advised that you execute a one-time migration of the data in Atlas and force all users to upgrade to the latest version of the app.
- ⚡️ If you can't force all users to update at the same time, you can do a live migration by adding an extra property for each Guid property that you have and write a trigger function that will migrate the data between the two. The old version of the app will write to the original property, while the new version will write to the new property and the trigger will convert between the two.
⚡️ If you are using sync and need to update to the latest version of the SDK but are not ready to migrate your data yet, see the
Opting out
section.Opting out
🛠 If for some reason, you want to opt out of the fixed behavior, you can temporarily opt out of it by setting the
Realm.UseLegacyGuidRepresentation
property totrue
. This is not recommended but can be used when you need more time to test out the migration while still getting bugfixes and other improvements. Setting it totrue
does two things:- It brings back the pre-10.10.0 behavior of reading/writing Guid values with little-endian representation.
⏪ 1. It disables the migration code for local Realms. Note that it will not revert the migration if you already opened the Realm file when
UseLegacyGuidRepresentation
was set tofalse
.
✨ Enhancements
- Lifted a limitation that would prevent you from changing the primary key of objects during a migration. It is now possible to do it with both the dynamic and the strongly-typed API:
csharp var config = new RealmConfiguration { SchemaVersion = 5, MigrationCallback = (migration, oldVersion) => { // Increment the primary key value of all Foos foreach (var obj in migration.NewRealm.All<Foo>()) { obj.Id = obj.Id + 1000; } } }
- 🚚 [Unity] The Realm menu item in the Unity Editor was moved to
Tools/Realm
to reduce clutter and align with other 3rd party editor plugins. (Issue #2807)
🛠 Fixed
- 🛠 Fixed an issue with xUnit tests that would cause
System.Runtime.InteropServices.SEHException
to be thrown whenever Realm was accessed in a non-async test. (Issue #1865) - 🛠 Fixed a bug that would lead to unnecessary metadata allocation when freezing a realm. (Issue #2789)
- 🛠 Fixed an issue that would cause Realm-managed objects (e.g.
RealmObject
, list, results, and so on) allocated during a migration block to keep the Realm open until they are garbage collected. This had subtle implications, such as being unable to delete the Realm shortly after a migration or being unable to open the Realm with a different configuration. (PR #2795) - 🛠 Fixed an issue that prevented Unity3D's IL2CPP compiler to correctly process one of Realm's dependencies. (Issue #2666)
- 🛠 Fixed the osx runtime path in the Realm NuGet package to also apply to Apple Silicon (universal) architectures (Issue #2732)
Compatibility
- Realm Studio: 11.0.0 or later.
Internal
- Using Core 11.10.0
-
v10.9.0 Changes
January 21, 2022✨ Enhancements
- ➕ Added support for a new mode of synchronization with MongoDB Realm, called "Flexible Sync". When using Flexible Sync, the client decides which queries it's interested in and asks the server for all objects matching these queries. The matching objects will be stored in a local Realm, just like before and can be queried and accessed while offline. This feature is in beta, so feedback - both positive and negative - is greatly appreciated and, as usual, we don't recommend using it for production workloads yet.
- Added a new configuration type, called
FlexibleSyncConfiguration
. Use this type to get aRealm
instance that uses the new synchronization mode with the server. - Deprecated the
SyncConfiguration
class in favor ofPartitionSyncConfiguration
. The two classes are equivalent and the new type is introduced to better contrast withFlexibleSyncConfiguration
. The two types are equivalent and allow you to open aRealm
instance that is using the old "Partition Sync" mode. - Added a new type, called
SubscriptionSet
. It is a collection, holding the various active query subscriptions that have been created for this Realm. This collection can be accessed via theRealm.Subscriptions
property. It will benull
for local and partition sync Realms and non-null for flexible sync Realms.
- Added a new configuration type, called
A minimal example would look like this:
var config = new FlexibleSyncConfiguration(user); var realm = Realm.GetInstance(config); // Add a new subscription realm.Subscriptions.Update(() => { var year2022 = new DateTimeOffset(2022, 1, 1); var saleOrders = realm.All<SaleOrder>().Where(o => o.Created > year2022); realm.Subscriptions.Add(saleOrders); }); // Wait for the server to acknowledge the subscription and return all objects // matching the query await realm.Subscriptions.WaitForSynchronizationAsync(); // Now we have all orders that existed on the server at the time of // subscribing. From now on, the server will send us updates as new // orders get created. var orderCount = realm.All<SaleOrder>().Count();
- Multiple subscriptions can be created for queries on the same class, in which case they'll be combined with a logical
OR
. For example, if you create a subscription for all orders created in 2022 and another for all orders created by the current user, your local Realm will contain the union of the two result sets. - Subscriptions can be named (which makes it easier to unsubscribe) or unnamed. Adding multiple unnamed subscriptions with the same query is a no-op.
- Modifying the set of active subscriptions is an expensive operation server-side, even if the resulting diff is not large. This is why we recommend batching subscription updates as much as possible to avoid overloading the server instance. A good practice is to declare the user subscriptions upfront - usually the first time the Realm is opened, and only update them when absolutely necessary.
- Find more information about the API and current limitations in the docs.
Compatibility
- Realm Studio: 11.0.0 or later.
Internal
- Using Core 11.8.0.
- 🚀 Release tests are executed against realm-qa instead of realm-dev. (PR #2771)
- ➕ Added support for a new mode of synchronization with MongoDB Realm, called "Flexible Sync". When using Flexible Sync, the client decides which queries it's interested in and asks the server for all objects matching these queries. The matching objects will be stored in a local Realm, just like before and can be queried and accessed while offline. This feature is in beta, so feedback - both positive and negative - is greatly appreciated and, as usual, we don't recommend using it for production workloads yet.
-
v10.8.0 Changes
January 17, 2022✨ Enhancements
- ➕ Added the
RealmConfigurationBase.FallbackPipePath
property. In the majority of cases this property can be left null, but it should be used when a realm is opened on a filesystem where named pipes cannot be created, such as external storage on Android that uses FAT32. In this case the path needs to point to a location on another filesystem where named pipes can be created. (PR #2766) - Added support arithmetric operations (+, -, *, /) in the string-based query syntax (
realm.All<Foo>().Filter("some-query")
). Operands can be properties and/or constants of numeric types (integer, float, double or Decimal128). You can now write a query like"(age + 5) * 2 > child.age"
. (Core upgrade)
🛠 Fixed
- 🛠 Fixed a race condition that could result in
Sharing violation on path ...
error when opening a Unity project on macOS. (Issue #2720, fix by @tomkrikorian) - 🛠 Fixed an error being thrown when
Realm.GetInstance
is called multiple times on a readonly Realm. (Issue #2731) - 🛠 Fixed a bug that would result in the
LIMIT
clause being ignored whenCount()
is invoked on aIQueryable
- e.g. expressions likerealm.All<Foo>().Filter("Bar > 5 LIMIT(1)).Count()
would ignore the limit in the string-based predicate and return the count of all matches. (Issue #2755) - 🛠 Fixed the logic in
RealmResultsVisitor.TraverseSort
to allow sorting on interface properties. (Issue #1373, contribution by @daawaan)
Compatibility
- Realm Studio: 11.0.0 or later.
Internal
- ➕ Added the
-
v10.7.1 Changes
November 19, 2021🛠 Fixed
- ⬆️ A sync user's Realm was not deleted when the user was removed if the Realm path was too long such that it triggered the fallback hashed name (this is OS dependant but is 300 characters on linux). (Core upgrade)
- ⬆️ Don't keep trying to refresh the access token if the client's clock is more than 30 minutes ahead. (Core upgrade)
- ⬆️ Don't sleep the sync thread artificially if an auth request fails. This could be observed as a UI hang on applications when sync tries to connect after being offline for more than 30 minutes. (Core upgrade)
Compatibility
- Realm Studio: 11.0.0 or later.
Internal
- Using Core 11.6.1.
-
v10.7.0 Changes
November 09, 2021✨ Enhancements
- ➕ Added the
Realm.SyncSession
property which will return the sync session for this Realm if the Realm is a synchronized one ornull
for local Realms. This is replacing theGetSession(this Realm)
extension method which is now deprecated. (PR #2711)
🛠 Fixed
- 🛠 Fixed a bug that would result in a
RealmException
being thrown when opening a readonly Realm with schema that is a superset of the schema on disk. Now the code will just work and treat any classes not present in the on-disk schema to be treated as empty collections - e.g.realm.All<ThisIsNotInOnDiskSchema>().Count == 0
. (Issue #2619) - 🛠 Fixed a bug that would create a "Documents" folder in the binary app folder when the ransomware protection in Windows is turned on. (Issue #2685)
- 🛠 Fixed an issue that would cause incorrect property implementation to be generated if
PropertyChanged.Fody
runs after the Realm weaver. (Issue #1873) - [Unity] Preserved additional constructors necessary to serialize and deserialize Custom User Data. (PR #2519)
- 🛠 Fixed an issue that would result in
InvalidOperationException
when concurrently creating aRealmConfiguration
with an explicitly setSchema
property. (Issue #2701) - 🏗 [Unity] Fixed an issue that would result in
NullReferenceException
when building for iOS when the Realm package hasn't been installed via the Unity Package Manager. (Issue #2698) - 🛠 Fixed a bug that could cause properties of frozen objects to return incorrect value/throw an exception if the provided Realm schema didn't match the schema on disk. (Issue #2670)
- 🛠 Fixed a rare assertion failure or deadlock when a sync session is racing to close at the same time that external reference to the Realm is being released. (Core upgrade)
- 🛠 Fixed an assertion failure when opening a sync Realm with a user who had been removed. Instead an exception will be thrown. (Core upgrade)
- 🛠 Fixed a rare segfault which could trigger if a user was being logged out while the access token refresh response comes in. (Core upgrade)
- 🛠 Fixed a bug where progress notifiers continue to be called after the download of a synced realm is complete. (Core upgrade)
- 👍 Allow for EPERM to be returned from fallocate(). This improves support for running on Linux environments with interesting filesystems, like AWS Lambda. Thanks to @ztane for reporting and suggesting a fix. (Core upgrade)
- 🛠 Fixed a user being left in the logged in state when the user's refresh token expires. (Core upgrade)
- ⬆️ SyncManager had some inconsistent locking which could result in data races and/or deadlocks, mostly in ways that would never be hit outside of tests doing very strange things. (Core upgrade)
Compatibility
- Realm Studio: 11.0.0 or later.
Internal
- Using Core 11.6.0.
- 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.
- 🔀 We now refresh the resulting Realm instance when opening a synchronized Realm with
GetInstanceAsync
. (Issue #2256) - ➕ Added Sync tests for all platforms running on cloud-dev. (Issue #2049)
- ➕ Added Android tests running on the emulator. (Issue #2680)
- 🚀 Started publishing prerelease packages to S3 using Sleet (feed url). (Issue #2708)
- 🏗 Enable LTO for all builds. (PR #2714)
- ➕ Added the
-
v10.6.0 Changes
September 30, 2021✨ Enhancements
- ➕ Added two extension methods on
ISet
to get anIQueryable
collection wrapping the set:set.AsRealmQueryable()
allows you to get aIQueryable<T>
fromISet<T>
that can be then treated as a regular queryable collection and filtered/ordered with LINQ orFilter(string)
.set.Filter(query, arguments)
will filter the set and return the filtered collection. It is roughly equivalent toset.AsRealmQueryable().Filter(query, arguments)
.
The resulting queryable collection will behave identically to the results obtained by calling
realm.All<T>()
, i.e. it will emit notifications when it changes and automatically update itself. (Issue #2555)- ➕ Added two new methods on
Migration
(Issue #2543):RemoveType(typeName)
allows to completely remove a type and its schema from a realm during a migration.RenameProperty(typeName, oldPropertyName, newPropertyName)
allows to rename a property during a migration.
- 🐎 A Realm Schema can now be constructed at runtime as opposed to generated automatically from the model classes. The automatic generation continues to work and should cover the needs of the vast majority of Realm users. Manually constructing the schema may be required when the shape of the objects depends on some information only known at runtime or in very rare cases where it may provide performance benefits by representing a collection of known size as properties on the class. (Issue #824)
RealmConfiguration.ObjectClasses
has now been deprecated in favor ofRealmConfiguration.Schema
.RealmSchema
has an implicit conversion operator fromType[]
so code that previously looked likeObjectClasses = new[] { typeof(Foo), typeof(Bar) }
can be trivially updated toSchema = new[] { typeof(Foo), typeof(Bar) }
.Property
has been converted to a read-only struct by removing the setters from its properties. Those didn't do anything previously, so we don't expect anyone was using them.- Added several factory methods on
Property
to simplify declaration of Realm properties by being explicit about the range of valid options - e.g.Property.FromType<int>("IntProperty")
orProperty.Object("MyPersonProp", "Person")
. The constructor ofProperty
is now public to support advanced scenarios, but we recommend using the factory methods. - Made
ObjectSchema.Builder
public and streamlined its API. It allows you to construct a mutable representation of the schema of a single object and add/remove properties to it. You can either get an empty builder or you can see it with the information from an existing model class (i.e. inheriting fromRealmObject
orEmbeddedObject
). - Made
RealmSchema.Builder
public and streamlined its API. It allows you to construct a mutable representation of the schema of an entire Realm and add/remove object schemas to it. - A simple example for how to use the new API would look like: ```csharp public class Person : RealmObject { public string Name { get; set; } public Address Address { get; set; } }
// Declare schema from existing model classes var config = new RealmConfiguration { Schema = new[] { typeof(Person), typeof(Address) } };
// Manually construct a schema - we don't need to call .Build() on the builders // because we have implicit conversion operators defined that will call it for us. // Explicitly calling .Build() is also perfectly fine, if a little more verbose. var config = new RealmConfiguration { Schema = new RealmSchema.Builder { new ObjectSchema.Builder("MyClass", isEmbedded: false) { Property.FromType("Id", isPrimaryKey: true), Property.PrimitiveDictionary("Tags", RealmValueType.String) }, new ObjectSchema.Builder("EmbeddedClass", isEmbedded: true) { Property.Primitive("DateProp", RealmValueType.Date, isNullable: true) } } };
// Enhance an existing model with new properties that will be accessible via // the dynamic API. var personSchema = new ObjectSchema.Builder(typeof(Person)) { Property.FromType("NewStringProp") };
var config = new RealmConfiguration { Schema = new RealmSchema.Builder { personSchema, new ObjectSchema.Builder(typeof(Address)) } };
// Regular Person properties can be accessed as usual while runtime defined ones // need to go through the dynamic API. var person = realm.All().First(); var name = person.Name; var stringPropValue = person.DynamicApi.Get("NewStringProp");
* 🛠 Fixed an issue that would result in SIGABORT on macOS/Linux when opening a Realm in dynamic mode (i.e. read the schema from disk) and the schema contains an object with no properties. (Issue [#1978](https://github.com/realm/realm-dotnet/issues/1978)) ### Compatibility * Realm Studio: 11.0.0 or later. ### Internal * Using Core 11.4.1. * 🚚 Moved perf tests to run on a self-hosted runner. (PR [#2638](https://github.com/realm/realm-dotnet/pull/2638))
- ➕ Added two extension methods on
-
v10.5.1 Changes
September 22, 2021🛠 Fixed
- 🛠 Fixed a bug that would cause a
NullReferenceException
to be reported during compilation of a class containing a getter-onlyRealmObject
property. (Issue #2576) - 🛠 Fixed an issue that would result in
Unable to load DLL 'realm-wrappers'
when deploying a WPF .NET Framework application with ClickOnce. This was due to the incorrect BuildAction type being applied to the native libraries that Realm depends on. (Issue #1877) - 🏗 [Unity] Fixed an issue that would fail Unity builds with
Multiple precompiled assemblies with the same name Mono.Cecil.dll
if importing the Realm package into a project that already referencesMono.Cecil
. (Issue #2630) - 🛠 Fixed a bug that would sometimes result in assemblies not found at runtime in a very specific edge scenario. More details about such a scenario can be found in its PR's description. (Issue #1568)
Compatibility
- Realm Studio: 11.0.0 or later.
Internal
- Using Core 11.4.1.
- 🛠 Fixed a bug that would cause a
-
v10.5.0 Changes
September 09, 2021✨ Enhancements
- ⬆️ ThreadSafeReference no longer pins the source transaction version for anything other than a Results backed by a Query. (Core upgrade)
- ⬆️ A ThreadSafeReference to a Results backed by a collection can now be created inside a write transaction as long as the collection was not created in the current write transaction. (Core upgrade)
- ⬆️ Synchronized Realms are no longer opened twice, cutting the address space and file descriptors used in half. (Core upgrade)
🛠 Fixed
- ⬆️ If an object with a null primary key was deleted by another sync client, the exception
KeyNotFound: No such object
could be triggered. (Core upgrade) - 🛠 Fixed a race condition that could result in an assertion
m_state == SyncUser::State::LoggedIn
if the app previously crashed during user logout. (Core upgrade)
Compatibility
- Realm Studio: 11.0.0 or later.
Internal
-
v10.4.1 Changes
September 03, 2021🛠 Fixed
- 🛠 Fixed a regression that would prevent the SDK from working on older Linux versions. (Issue #2602)
- 🛠 Fixed an issue that manifested in circumventing the check for changing a primary key when using the dynamic API - i.e.
myObj.DynamicApi.Set("Id", "some-new-value")
will now correctly throw aNotSupportedException
if"some-new-value"
is different frommyObj
's primary key value. (PR #2601)
Compatibility
- Realm Studio: 11.0.0 or later.
Internal