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

Save Eventually doesn't save nested new, unsaved, child objects. #1604

Open
PBeninga opened this issue Feb 12, 2021 · 1 comment
Open

Save Eventually doesn't save nested new, unsaved, child objects. #1604

PBeninga opened this issue Feb 12, 2021 · 1 comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@PBeninga
Copy link

PBeninga commented Feb 12, 2021

I am trying to support offline save operations with save eventually and I am running into an issue.

Let's say I have a TodoList class which has a relations to TodoListItem. What I would like to do when a new item is created is to create a relation between todoList and the new object, then save the new todoList
by calling todoList.saveEventually(), Right now it fails with Tried to save an object with a new, unsaved child. (Code: -1, Version: 1.19.1).

It fails because the object to be saved doesn't have an object id, but thats expected as it was created offline. We can't just enqueue two save eventually operations as both happen async and it is a race condition. Ideally we would create a callback from save eventually to do it, but as I said its offline so there is a very strong chance the completion block isn't around when the call completes.

Is there a way to support saving nested objects while offline?

@stale
Copy link

stale bot commented Jul 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. If you believe it should stay open, please let us know! As always, we encourage contributions, check out the Contributing Guide

@stale stale bot added the Stale label Jul 21, 2021
@mtrezza mtrezza removed the Stale label Oct 14, 2021
@mtrezza mtrezza added state:needs-investigation type:bug Impaired feature or lacking behavior that is likely assumed labels Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants