-
Notifications
You must be signed in to change notification settings - Fork 167
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
Crash on object update or delete #6585
Comments
Hi Dan! |
The issue is that while removing an object we are trying to remove the backlinks pointing back to the deleted object. We do that by following the forward links and then search for the key of the deleted object. If that key is not found an assertion will be triggered. It is a sign that some inconsistency is found (a forward link with no matching backward link). We might consider just ignoring the inconsistency silently as that would allow you to still use the realm file. |
@bodnar-dan Can you disclose what your schema looks like? How are the properties on the object that you are removing defined? |
@bodnar-dan Although we have closed this, I think there is more to this than what our fix fixes. So I would very much like to hear if the Dictionary you use is a Dictionary of embedded objects? |
Are any of you using sync? |
@bodnar-dan @alexeyfof could you provide some additional information? Schema definition and code samples would be great to see! |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
SDK and version
SDK : realm-swift
Version: 10.35.1
Observations
Crash log / stacktrace
Steps & Code to Reproduce
According to the logs, this happens when the user tries to update or delete a specific Realm Object.
The involved
ObjectA
has a small number of properties it self, but it includes a List of embedded objectsList<[ChildObjectA]> (Embedded)
, which more often then not, it's a list with 1 element. This specificChildObjectA
has a link with anObjectB
(not embedded) that has further links with List of other objects. When updatingObjectA
, in this specific case, we are actually creating a new instance of it and pass the old primary key value. So instead of modifying one or more properties, we callrealm.add
but with the update policy set tooverride all the properties, even if not changed
.From the stack trace, it seems we are hitting a Realm assert (
REALM_ASSERT_3
called inArrayBacklink::remove
), but we were not able to reproduce nor to understand in what situations is this happening.I am unable to share code, but I can provide more information on the Objects involved, if needed, such as a more detailed data structure and the manipulation.
The text was updated successfully, but these errors were encountered: