Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fix failing sync tests #3096
Fix failing sync tests #3096
Changes from all commits
f4f4f1f
76dcef0
1263868
225698d
beb71ce
55f07d6
cad926e
16a892b
2b062a0
6697d9a
8965a14
4de48f2
23820a7
cdf5d01
ed90bfa
9cf7206
54d8276
3a3d8af
0833f03
5b97433
12b0039
4a388e9
7b59e74
a280928
ca3d70f
8d65a02
9d2579c
cfd54b6
5640642
e732b56
6aae0aa
4870a4e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would make sense to move this message to core?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat c#-specific message, so I don't think the Core team would like to adopt it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the behavior to always remove the Realm from the state, even when it's unowned. The reason is that otherwise we ended up not closing the Realm in certain situations. Example:
At point (1), we create an unowned Realm instance -
r
. When created, it will create aRealmState
and set it to the native instance. At point (2), we get a regular Realm instance, that points to the same native Realm asr
. This means that the state now references two Realms -r
andrealm
. When we disposerealm
, we remove it from the state, but we don't close the native realm because we see that the_weakRealms
collection is not empty.With this change, we remove unowned realms from the state, but don't explicitly call
close
on the native Realm, because we don't own it (yet). When an owned instance is created for the native Realm, we're free to close it, because there won't be unowned managed instances that keep it around.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to reset the original logger?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done automatically in
RealmTest.TearDown