Conversation
|
|
||
| protected override void CustomTearDown() | ||
| { | ||
| base.CustomTearDown(); |
There was a problem hiding this comment.
If a Realm is disposed its sync session should be automatically disposed, so does this manual cleanup have the goal of speeding up the process of memory release or is there more to it?
There was a problem hiding this comment.
A sync session is independent of the Realm - it may certainly outlive the managed instance. The issue with the order here was that we were calling the base teardown method which disposes and deletes all Realm instances before disposing the session handles. This resulted in race conditions where if a session hasn't been disposed, the deletion would fail.
There was a problem hiding this comment.
Then I misinterpreted this comment; I assume it simply meant that the user doesn't have to care to manually deallocating it.
Thank you for the explanation.
There was a problem hiding this comment.
Yes, the automatic lifespan management means that we'll create and terminate sessions based on certain heuristics/internal rules. Typically, this will mean that a session outlives its Realm so that it can upload any remaining changes. This has the unfortunate side effect that deleting a synchronized Realm, even after disposing it, is not exactly safe. This will hopefully be addressed by realm/realm-core#4424.
Description
This is mostly a cleanup PR that achieves the following:
OrderBy(...).OrderBy(...)query chains by having the last clause replace all preceding ones.RealmMigrationNeededExceptionwhen opening a readonly file that uses an old core format.TODO