Skip to content
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

Orphaned embedded objects are not deleted when migrating from Object to Embedded Object #6073

Closed
jlachewitz opened this issue Aug 17, 2023 · 0 comments · Fixed by #6076
Closed

Comments

@jlachewitz
Copy link

jlachewitz commented Aug 17, 2023

How frequently does the bug occur?

Always

Description

This issue has previously been noted and resolved in realm-java and realm-kotlin:

realm/realm-java#7769
realm/realm-kotlin#1464

Orphaned documents should be handled automatically according to this change in realm-core:
realm/realm-core#5737

The issue occurs when migrating a schema for a local realm. Version 2 of the schema has three object models defined. Version 3 of the schema embeds each of these three object models into one another in order to take advantage of cascading deletes. When the existing realm is attempted to be migrated from version 2 to 3, the following error is received:

"Failed to open local Realm for {REALM_INSTANCE} - Error: ","args":["Cannot convert '{OBJECT}' to embedded: at least one object has no incoming links and would be deleted."]

Stacktrace & log output

"Failed to open local Realm for {REALM_INSTANCE} - Error: ","args":["Cannot convert '{OBJECT}' to embedded: at least one object has no incoming links and would be deleted."]

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

11.3.1

What services are you using?

Local Database only

Are you using encryption?

  • select --

Platform OS and version(s)

Electron 22.3.14

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants