Realm is a mobile database: a replacement for SQLite & ORMs
APACHE-2.0 License
Bot releases are visible (Hide)
>
, >=
, <
, <=
operators in Realm.Filter()
queries for string constants. This is a case sensitive lexicographical comparison. Improved performance of RQL (.Filter()
) queries on a non-linked string property using: >, >=, <, <=, operators and fixed behaviour that a null string should be evaluated as less than everything, previously nulls were not matched. (Core 13.26.0-14-gdf25f)IList<RealmObject>
or IList<RealmValue>
that operated on indices that were not also added in the recovery, links to an object which had been deleted by another client while offline would be recreated by the recovering client. But the objects of these links would only have the primary key populated and all other fields would be default values. Now, instead of creating these zombie objects, the lists being recovered skip such deleted links. (Core 13.24.0)__atomic_is_lock_free
on ARMv7 Linux (Core 13.26.0)Published by github-actions[bot] 11 months ago
Published by github-actions[bot] 12 months ago
Added the App.EmailPasswordAuth.RetryCustomConfirmationAsync
method to be able to run again the confirmation function on the server for a given email. (Issue #3463)
Added User.Changed
event that can be used to notify subscribers that something about the user changed - typically this would be the user state or the access token. (Issue #3429)
Added support for customizing the ignore attribute applied on certain generated properties of Realm models. The configuration option is called realm.custom_ignore_attribute
and can be set in a global configuration file (more information about global configuration files can be found in the .NET documentation). The Realm generator will treat this as an opaque string, that will be appended to the IgnoreDataMember
and XmlIgnore
attributes already applied on these members. The attributes must be fully qualified unless the namespace they reside in is added to a global usings file. For example, this is how you would add JsonIgnore
from System.Text.Json
:
realm.custom_ignore_attribute = [System.Text.Json.Serialization.JsonIgnore]
(Issue #2579)
The Realm source generator will now error out in case a collection in the model classes is assigned to a non-null value either in a property initializer or in a constructor. Realm collections are initialized internally and assigning non-null values to the property is not supported, where the null!
assignment is only useful to silence nullable reference type warnings, in reality the collection will never be null. (Issue #3455)
Made WebSocket error logging more verbose when using AppConfiguration.UseManagedWebSockets = true
. #3459
not
in the generated code, so that it's compatible with a minumum C# version of 8.0. (Issue #3265)Published by github-actions[bot] about 1 year ago
SessionException
. A few error codes have been combined and some have been deprecated since they are no longer reported by the server. (Issue #3295)MissingMemberException
being thrown when attempting to access a non-existent property with the dynamic API. (PR #3432)Cannot marshal generic Windows Runtime types with a non Windows Runtime type as a generic type argument
build error when using .NET Native. (Issue #3434, since 11.4.0)Published by github-actions[bot] about 1 year ago
IQueryable.SubscribeAsync
API as a shorthand for using SubscriptionSet.Add
. It is a syntax sugar that roughly translates to:
realm.Subscriptions.Update(() =>
{
realm.Subscriptions.Add(query);
});
await realm.Subscriptions.WaitForSynchronization();
// This can now be expressed as
await query.SubscribeAsync();
It offers a parameter to control whether to wait every time for synchronization or just the first time a subscription is added, as well as cancellation token support. (PR #3403)cancellationToken
argument to Session.WaitForDownloadAsync/WaitForUploadAsync
. (PR #3403)cancellationToken
argument to SubscriptionSet.WaitForSynchronization
. (PR #3403)Column has no fulltext index
. (Core 13.17.1)System.Net.WebSockets.ClientWebSocket
) instead of Realm's built-in WebSocket client for Sync traffic. Managed WebSockets offer improved support for proxies and firewalls that require authentication. This feature is currently opt-in and can be enabled by setting AppConfiguration.UseManagedWebSockets
to true. Managed WebSockets will become the default in a future version. (PR #3412).realm.SyncSession
garbage collected even when there are subscribers to realm.SyncSession.PropertyChanged
.ObjectDisposedException : Safe handle has been closed
being thrown. (PR #3400)Realm.RefreshAsync
, that exception would have been ignored and false
would have been returned. (PR #3400)SubscriptionSet.Find
to correctly indicate that null
is returned if the subscription doesn't exist in the subscription set. (PR #3403)Filter
queries using remapped properties would only work with the native name rather than the managed one. Now both will work - e.g.:
partial class MyModel : IRealmObject
{
[MapTo("Bar")]
public int Foo { get; set; }
}
// Both of these are valid now
realm.All<MyModel>().Filter("Foo > 5");
realm.All<MyModel>().Filter("Bar > 5");
(Issue #3149)Published by github-actions[bot] about 1 year ago
AppConfiguration.LocalAppName
and AppConfiguration.LocalAppVersion
have been deprecated and will be removed in a future version. They have never had an effect as the values supplied by the SDK was never sent to the server. (PR #3387)App.BaseFilePath
, App.BaseUri
, and App.Id
properties that return the values supplied in AppConfiguration
. (PR #3385)AppConfiguration.UseAppCache
property that controls whether the App
instance returned from App.Create
should be cached or not. The general recommendation is to not set it (i.e. leave the default value of true
), but it can be useful when writing unit tests. (Issue #3382).Realm.GetInstanceAsync
operation is in progress. (Issue #3344)App.Equals
and App.GetHashCode
to return correct results, particularly when the App
instance is cached. (PR #3385)Published by github-actions[bot] over 1 year ago
IndexOf(null)
on a collection of non-nullable types. Previously, this would throw an ArgumentNullException
whereas now it will return -1
. This is particularly useful for data-binding scenarios where the binding engine might invoke it as IndexOf(SelectedItem)
which would throw an exception when SelectedItem
is null
. (PR #3369)RealmSet.IndexOf
implementation to return the actual result rather than throw a NotSupportedException
. The order of persisted sets is still non-deterministic, but is stable between write transactions. Again, this is mostly useful for data-binding scenarios where the set is passed as a binding context to a collection control. (PR #3369)Could not analyze the user's assembly. Cannot access a closed Stream.
. (Issue #3364
NullReferenceException
when weaving classes on Unity in batch mode. (Issue #3363)Published by github-actions[bot] over 1 year ago
'Realm' is a namespace but is used like a type
. (Issue #3351)Published by github-actions[bot] over 1 year ago
'Realm' is a namespace but is used like a type
. (Issue #3351)Published by github-actions[bot] over 1 year ago
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)RealmObject
->EmbeddedObject
migrations by duplicating objects referenced by multiple parents as well as removing "orphaned" objects. (Issue #2408).Filter("TRUEPREDICATE SORT(meta['age'])")
. (Core 13.14.0)public partial class Location : IEmbeddedObject
{
// The coordinates and type properties are mandatory but may be private.
// You can add more fields if necessary - those will be ignored when doing
// geospatial queries.
[MapTo("coordinates")]
private IList<double> Coordinates { get; } = null!;
[MapTo("type")]
private string Type { get; set; } = "Point";
public double Latitude => Coordinates.Count > 1 ? Coordinates[1] : throw new Exception($"Invalid coordinate array. Expected at least 2 elements, but got: {Coordinates.Count}");
public double Longitude => Coordinates.Count > 1 ? Coordinates[0] : throw new Exception($"Invalid coordinate array. Expected at least 2 elements, but got: {Coordinates.Count}");
public Location(double latitude, double longitude)
{
// According to the GeoJson spec, longitude must come first in the
// coordinates array.
Coordinates.Add(longitude);
Coordinates.Add(latitude);
}
}
// Example usage
public partial class Company : IRealmObject
{
public Location Location { get; set; }
}
GeoPoint
: a building block for the other shape types - it cannot be used as a property type on your models and is only intended to construct the other shape types. It can be constructed implicitly from a value tuple of latitude and longitude:
var point = new GeoPoint(latitude: 12.345, longitude: 67.890);
var point = (12.345, 67.890);
GeoCircle
: a shape representing a circle on a sphere constructed from a center and radius:
var circle = new GeoCircle(center: (12.34, 56.78), radius: 10); // radius in radians
var circle = new GeoCircle((12.34, 56.78), Distance.FromKilometers(10));
GeoBox
: a shape representing a box on a sphere constructed from its bottom left and top right corners:
var box = new GeoBox((12.34, 56.78), (15.34, 59.78));
GeoPolygon
: an arbitrary polygon constructed from an outer ring and optional holes:
var polygon = new GeoPolygon((10, 10), (20, 20), (0, 20), (10, 10)); // a triangle with no holes
var outerRing = new GeoPoint[] { (10, 10), (20, 20), (0, 20), (10, 10) };
var hole1 = new GeoPoint[] { (1, 1), (2, 2), (0, 2), (1, 1) };
var hole2 = new GeoPoint[] { (5, 5), (6, 6), (4, 6), (5, 5) };
var polygon = new GeoPolygon(outerRing, hole1, hole2); // A triangle with two smaller triangular holes
var matches = realm.All<Company>().Where(c => QueryMethods.GeoWithin(c.Location, circle));
var matches = realm.All<Company>().Filter("Location GEOWITHIN $0", circle);
realm.All<MyModel>().Filter("TRUEPREDICATE SORT(meta['age'])")
. (Core 13.14.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)Can't link to an embedded object that is already managed
. Now it is a no-op instead. (Issue #3262)Published by github-actions[bot] over 1 year ago
error
argument in NotificationCallbackDelegate
and DictionaryNotificationCallbackDelegate
used in *collection*.SubscribeForNotifications
has been removed. It has been unused for a long time, since internal changes to the database made it impossible for errors to occur during notification callbacks. (Issue #3014)RealmObjectBase.GetBacklinks
- instead RealmObjectBase.DynamicApi.GetBacklinksFromType
should be used. (Issue #2391)Realm.DynamicApi.CreateObject(string, object)
and replaced it with more specialized overloads:
RealmObjectBase.DynamicApi.CreateObject(string)
can be used to create an object without a primary key.RealmObjectBase.DynamicApi.CreateObject(string, string/long?/ObjectId?/Guid?)
can be used to create an object with a primary key of the corresponding type.Realm.DynamicApi
no longer return dynamic
, instead opting to return concrete types, such as IRealmObject
, IEmbeddedObject
, and so on. You can still cast the returned objects to dynamic
and go through the dynamic API, but that's generally less performant than using the string-based API, such as IRealmObjectBase.DynamicApi.Get/Set
, especially on AOT platforms such as iOS or Unity. (Issue #2391)Realm.WriteAsync(Action<Realm>)
in favor of Realm.WriteAsync(Action)
. The new WriteAsync
method introduced in 10.14.0 is more efficient and doesn't require reopening the Realm on a background thread. While not recommended, if you prefer to get the old behavior, you can write an extension method like:
public static async Task WriteAsync(this Realm realm, Action<Realm> writeAction)
{
await Task.Run(() =>
{
using var bgRealm = Realm.GetInstance(realm.Config);
bgRealm.Write(() =>
{
writeAction(bgRealm);
});
});
await realm.RefreshAsync();
}
(PR #3234)InMemoryConfiguration.EncryptionKey
. It was never possible to encrypt in-memory Realms and setting that property would have resulted in runtime errors. (PR #3236)SyncConfiguration
- use PartitionSyncConfiguration
or FlexibleSyncConfiguration
instead. (PR #3237)Realm.GetSession
- use Realm.SyncSession
instead. (PR #3237)DiscardLocalResetHandler
- use DiscardUnsyncedChangedHandler
instead. (PR #3237)Session.SimulateClientReset
extensions. These didn't work with automatic reset handlers and were more confusing than helpful. (PR #3237)AppConfiguration.CustomLogger
and AppConfiguration.LogLevel
- use Logger.Default
and Logger.LogLevel
instead. (PR #3238)RealmConfigurationBase.ObjectClasses
- use RealmConfigurationBase.Schema
instead. (PR #3240)ObjectSchema.IsEmbedded
- use ObjectSchema.BaseType
instead. (PR #3240)ObjectSchema.Builder.IsEmbedded
- use ObjectSchema.Builder.RealmSchemaType
instead. (PR #3240)ObjectSchema.Builder(string name, bool isEmbedded = false)
- use Builder(string name, ObjectSchemaType schemaType)
instead. (PR #3240)RealmSchema.Find
- use RealmSchema.TryFindObjectSchema
instead. (PR #3240)User.GetPushClient
as it has been deprecated in Atlas App Services - see https://www.mongodb.com/docs/atlas/app-services/reference/push-notifications/. (PR #3241)SyncSession.Error
event - use SyncConfigurationBase.OnSessionError
when opening a Realm instead. (PR #3241)ManualRecoveryHandler
- use the one that takes a callback instead. (PR #3241)RealmValue.AsString
will now throw an exception if the value contains null
. If you want to get a nullable string, use AsNullableString
. (PR #3245)RealmValue.AsData
will now throw an exception if the value contains null
. If you want to get a nullable byte[]
, use AsNullableData
. (PR #3245)RealmValue.AsRealmObject
will now throw an exception if the value contains null
. If you want to get a nullable string, use AsNullableRealmObject
. (PR #3245)Realm.SyncSession
will now throw an error if the Realm is not opened with a PartitionSyncConfiguration
or FlexibleSyncConfiguration
- before it used to return null
. (PR #3245)Realm.Subscriptions
will now throw an error if the Realm is not opened with a FlexibleSyncConfiguration
- before it used to return null
. (PR #3245)PermissionDeniedException
as it was no longer possible to get it. (Issue #3272)ErrorCode
enum. All codes removed were obsolete and no longer emitted by the server. (PR 3273)IncompatibleSyncedFileException
as it was no longer possible to get it. (Issue #3167)Realms.Schema.Property
API now use IndexType
rather than a boolean indicating whether a property is indexed. (Issue #3281)StringExtensions
(Like
, Contains
) are now deprecated. Use the identical ones in QueryMethods
instead - e.g. realm.All<Foo>().Where(f => f.Name.Like("Mic*l"))
would need to be rewritten like realm.All<Foo>().Where(f => QueryMethods.Like(f.Name, "Mic*l"))
.myList[1] = someObj
) will now correctly raise CollectionChange
notifications with the Replace
action. (Issue #2854)[Indexed(IndexType.FullText)]
attribute.QueryMethods.FullTextSearch
: realm.All<Book>().Where(b => QueryMethods.FullTextSearch(b.Description, "fantasy novel"))
.Filter
queries, use the TEXT
operator: realm.All<Book>().Filter("Description TEXT $0", "fantasy novel")
.IQueryable.Count()
) the number of exact matches (with no other query conditions) on a string/int/UUID/ObjectID property that has an index. This improvement will be especially noticiable if there are a large number of results returned (duplicate values).DateTimeOffset
property that has an index.RealmValue
property that has an index.RealmValue
property that does not have an index.RealmValue
.The specified table name is already in use
exception when creating a new Realm file on multiple threads. (Issue #3302)RealmValue
property with a string operator (contains/like/beginswith/endswith) or with case insensitivity. (Core 13.8.0)RealmValue
property was returning case insensitive matches. For example querying for myIndexedValue == "Foo"
would incorrectly match on values of "foo" or "FOO" etc. (Core 13.8.0)RealmValue
property on a non-empty table would crash with an assertion. (Core 13.8.0)SyncSession.Stop()
could hold a reference to the database open after shutting down the sync session, preventing users from being able to delete the realm. (Core 13.8.0)ClientResetException.InitiateClientReset()
no longer ignores the result of trying to remove a realm. This could have resulted in a client reset action being reported as successful when it actually failed on windows if the Realm
was still open. (Core 13.9.0){1, 2, 3, ...} IN list
where the array is longer than 8 and all elements are smaller than some values in list, the program would crash (Core 13.9.4)Published by github-actions[bot] over 1 year ago
SyncConfiguration.CancelAsyncOperationsOnNonFatalErrors
which controls whether async operations (such as Realm.GetInstanceAsync
, Session.WaitForUploadAsync
and so on) should throw an exception whenever a non-fatal session error occurs. (Issue #3222)AppConfiguration.SyncTimeoutOptions
which has a handful of properties that control sync timeouts, such as the connection timeout, ping-pong intervals, and others. (Issue #3223)ArgumentException
when invalid arguments are provided rather than RealmException
. (Issue #2796)CompensatingWriteException
that contains information about the writes that have been reverted by the server due to permissions. It will be passed to the supplied FlexibleSyncConfiguration.OnSessionError
callback similarly to other session errors. (Issue #3258)BsonSerializer.RegisterSerializer
, which would conflict if your app was using the MongoDB.Bson
package and defined its own serializers for DateTimeOffset
, decimal
, or Guid
. Now, registration happens via BsonSerializer.RegisterSerializationProvider
, which means that the default serializers used by the SDK can be overriden by calling BsonSerializer.RegisterSerializer
at any point before a serializer is instantiated or by calling BsonSerializer.RegisterSerializationProvider
after creating an App/opening a Realm. (Issue #3225)Published by github-actions[bot] over 1 year ago
File format version bumped. Old files will be automatically upgraded but cannot be downgraded and opened with older versions of the .NET SDK.
User.GetPushClient
has been deprecated as it will be disabled soon on the server. (Issue #3073)The realm file will be shrunk if the larger file size is no longer needed. (Core 13.0.0)
Most of the file growth caused by version pinning is eliminated. (Core 13.0.0)
Improve performance of acquiring read locks when a read lock for that version is already held. This speeds up many operations related to change notifications, and particularly refreshing a Realm which has change notifiers registered. (Core 13.2.0)
Upgrade OpenSSL from 1.1.1n to 3.0.7. (Core 13.2.0)
Converting flexible sync realms to bundled and local realms is now supported (Core 13.2.0)
Add support for nested classes for source generated classes. (Issue #3031)
Enhanced support for nullable reference types in the model definition for source generated classes. This allows to use realm models as usual when nullable context is active, and removes the need to use of the Required
attribute to indicate required properties, as this information will be inferred directly from the nullability status. There are some considerations regarding the nullability of properties that link to realm object:
Defining the properties with a different nullability annotation than what has been outlined here will raise a diagnostic error. For instance:
public partial class Person: IRealmObject
{
//Single values
public Dog? MyDog { get; set; } //Correct
public Dog MyDog { get; set; } //Error
//List
public IList<Dog> MyDogs { get; } //Correct
public IList<Dog?> MyDogs { get; } //Error
//Set
public ISet<Dog> MyDogs { get; } //Correct
public ISet<Dog?> MyDogs { get; } //Error
//Dictionary
public IDictionary<string, Dog?> MyDogs { get; } //Correct
public IDictionary<string, Dog> MyDogs { get; } //Error
//Backlink
[Realms.Backlink("...")]
public IQueryable<Dog> MyDogs { get; } //Correct
[Realms.Backlink("...")]
public IQueryable<Dog?> MyDogs { get; } //Error
}
We realise that some developers would still prefer to have more freedom in the nullability annotation of such properties, and it is possible to do so by setting realm.ignore_objects_nullability = true
in a global configuration file (more information about global configuration files can be found in the .NET documentation). If this is enabled, all the previous properties will be considered valid, and the nullability annotations for properties linking to objects will be ignored.
Improved performance of PropertyChanged
and CollectionChanged
notifications. (Issue #3112)
Added support for tvOS in Xamarin/MAUI and Unity applications. (Issue #3161)
Improve the performance of Realm.Freeze()
. (Core 13.3.0)
ISet<RealmValue>
consider string and binary data equivalent. This could cause the client to be inconsistent with the server if a string and some binary data with equivalent content was inserted from Atlas. (Core 13.0.0)RealmObject
. (Issue #3162)PropertyChanged
notifications to be delivered for collection properties when the content of the collection was modified even if the collection itself was not replaced. (Issue #3112)System.InvalidOperationException
. (Issue #3199)Session.Stop
will now correctly keep the session stopped until Session.Start
is called. Previously, there were a number of circumstances that could cause the session to be resumed, even if not explicitly requested. (Core 13.3.0)Published by github-actions[bot] almost 2 years ago
Removed redundant serialization/deserialization of arguments in CallAsync. (Issue #3079)
Added a field Transaction.State
which describes the current state of the transaction. (Issue #2551)
Improved error message when null is passed as argument to params for EmailPasswordAuth.CallResetPasswordFunctionAsync. (Issue #3011)
Removed backing fields of generated classes' properties which should provide minor improvements to memory used by Realm Objects (Issue #2647)
Added two extension methods on IDictionary
to get an IQueryable
collection wrapping the dictionary's values:
dictionary.AsRealmQueryable()
allows you to get a IQueryable<T>
from IDictionary<string, T>
that can be then treated as a regular queryable collection and filtered/ordered with LINQ or Filter(string)
.dictionary.Filter(query, arguments)
will filter the list and return a filtered collection of dictionary's values. It is roughly equivalent to dictionary.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 #2647)
Improve performance of client reset with automatic recovery and converting top-level tables into embedded tables. (Core upgrade)
Flexible sync will now wait for the server to have sent all pending history after a bootstrap before marking a subscription as Complete. (Core upgrade)
Slightly improve performance of Realm.RemoveAll()
which removes all objects from an open Realm database. (Issue #2233)
Improve error messages when not setting a BaseFilePath for realm or app configuration. (Issue 2863)
Added diagnostic error for nested classes used with the source generator syntax, as they are not yet supported. (Issue #3130)
Added IList
implementation to all Realm collections to allow for UWP ListView databinding. (Issue #1759)
IEmbeddedObject
s and IAsymmetricObject
s from being used as RealmValue
s when added to a realm, and displaying more meaningful error messages.SubscriptionSet.WaitForSynchronizationAsync
. (Issue #2952)string.Contains
in .NET 2.1 or later where the search string is not a literal. (Issue #3134)[Obsolete]
notice for a few ErrorCode
enum members that are no longer in use. (Issue #3155
Realm.RefreshAsync
with a native implementation. (PR #2995)Published by github-actions[bot] almost 2 years ago
Introduced Realm.SourceGenerator
, a Source Generator that can generate Realm model classes. This is part of our ongoing effort to modernize the Realm library, and will allow to introduce certain language level features easier in the future.
In order to use the source generation the model classes need to be declared implementing one of the base interfaces (IRealmObject
, IEmbeddedObject
or IAsymmetricObject
) and be declared partial. For example:
public partial class Person: IRealmObject
{
public int Age { get; set; }
public string Name { get; set; }
public PhoneNumber Phone { get; set; }
}
public partial class PhoneNumber: IEmbeddedObject
{
public string Number { get; set; }
public string Prefix { get; set; }
}
The source generator will then take care of adding the full implementation for the interfaces.
Most of the time converting the "classic" Realm model classes (classes derived from RealmObject
, EmbeddedObject
or AsymmetricObject
) to use the new source generation means just defining the class as partial and switching out the base class for the corresponding interface implementation.
The classic Realm model definition will still be supported, but will be phased out in the future.
Please note that the source generator is still in beta, so let us know if you experience any issue while using them.
Some additional notes:
OnManaged
and OnPropertyChanged
are now partial methods.PropertyChanged
notifications on a Session
instance that is then garbage collected prior to unsubscribing. (PR #3061)Published by github-actions[bot] about 2 years ago
NullReferenceException
occurring in RealmObjectBase
's finalizer whenever an exception is thrown before the object gets initialized. (Issue #3045)Published by github-actions[bot] about 2 years ago
Introduced AsymmetricObject
intended for write-heavy workloads, where high performance is generally important. This new object:
EmbeddedObject
s but cannot link to RealmObject
or AsymmetricObject
.In the same write transaction, it is legal to add AsymmetricObject
s and RealmObject
s
class Measurement : AsymmetricObject
{
[PrimaryKey, MapTo("_id")]
public Guid Id { get; private set; } = Guid.NewGuid();
public double Value { get; set; }
public DataTimeOffset Timestamp { get; private set; } = DateTimeOffset.UtcNow;
}
class Person : RealmObject
{
//............
}
//.....
var measurement = new Measurement
{
Value = 9.876
};
realm.Write(() =>
{
realm.Add(measurement);
realm.Add(new Person());
});
_ = asymmetricObject.Value; // runtime error
_ = realm.All<Measurement>(); // compile time error
Added two client reset handlers, RecoverUnsyncedChangesHandler
and RecoverOrDiscardUnsyncedChangesHandler
, that try to automatically merge the unsynced local changes with the remote ones in the event of a client reset. Specifically with RecoverOrDiscardUnsyncedChangesHandler
, you can fallback to the discard local strategy in case the automatic merge can't be performed as per your server's rules. These new two stragegies simplify even more the handling of client reset events when compared to DiscardUnsyncedChangesHandler
.RecoverOrDiscardUnsyncedChangesHandler
is going to be the default from now on. An example is as follows
Added two client reset handlers, RecoverUnsyncedChangesHandler
and RecoverOrDiscardUnsyncedChangesHandler
, that try to automatically merge the unsynced local changes with the remote ones in the event of a client reset. Specifically with RecoverOrDiscardUnsyncedChangesHandler
, you can fallback to the discard unsynced strategy in case the automatic merge can't be performed as per your server's rules. These new two stragegies simplify even more the handling of client reset events when compared to DiscardUnsyncedChangesHandler
.RecoverOrDiscardUnsyncedChangesHandler
is going to be the default from now on. More info on the aforementioned strategies can be found in our docs page. An example usage of one of the new handler is as follows:
var conf = new PartitionSyncConfiguration(partition, user)
{
ClientResetHandler = new RecoverOrDiscardUnsyncedChangesHandler
{
// As always, the following callbacks are optional
OnBeforeReset = (beforeFrozen) =>
{
// executed right before a client reset is about to happen
},
OnAfterRecovery = (beforeFrozen, after) =>
{
// executed right after an automatic recovery from a client reset has completed
},
OnAfterDiscard = (beforeFrozen, after) =>
{
// executed after an automatic recovery from a client reset has failed but the DiscardUnsyncedChanges fallback has completed
},
ManualResetFallback = (session, err) =>
{
// handle the reset manually
}
}
};
(PR #2745)
Introducing string query support for constant list expressions such as realm.All<Car>().Filter("Color IN {'blue', 'orange'}")
. This also includes general query support for list vs list matching such as realm.All<Car>().Filter("NONE Features IN {'ABS', 'Seat Heating'}")
. (Core upgrade)
Improve performance when a new Realm file connects to the server for the first time, especially when significant amounts of data has been written while offline. (Core upgrade)
Shift more of the work done on the sync worker thread out of the write transaction used to apply server changes, reducing how long it blocks other threads from writing. (Core upgrade)
Improve the performance of the sync changeset parser, which speeds up applying changesets from the server. (Core upgrade)
[TargetFramework]
defined. (Issue #2843)SyncConfiguration
did not set the schema version, which could lead to m_schema_version != ObjectStore::NotVersioned
assertion failures. (Core upgrade)Session.WaitForUploadAsync
) may have called before the download message that completed them was fully integrated. (Core upgrade)Realm.Refresh()
did not actually advance to the latest version in some cases. If there was a version newer than the current version which did not require blocking it would advance to that instead, contrary to the documented behavior. (Core upgrade)Published by github-actions[bot] about 2 years ago
User.ToString()
that outputs the user id and provider. (PR #2988)User
that matches the behavior of User.Equals
. (PR #2988)Published by github-actions[bot] about 2 years ago
RealmValue
from a RealmObject
to null or any other non-RealmObject value. Users may have seen exception of "key not found" or assertion failures such as mixed.hpp:165: [realm-core-12.1.0] Assertion failed: m_type
when removing the destination object. (Core upgrade)