-
Notifications
You must be signed in to change notification settings - Fork 156
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
Relationships end up in an inconsistent state #114
Comments
I've fixed some bugs in my prototype and added some debug console output: Start from an empty list, create a number of tasks and start rearranging them while looking into browser console. You'll see that the info (reported from iterating But once you refresh the page, item positions are messed up as well as item parents/children. PS I haven't implemented automatic position correction, so once |
@lolmaus unfortunately, I'm not currently in any project using LS :( did you find a fix for this? |
After over two years, this is still an issue! |
Hi!
I'm building a hierarchical todo list, using HollyApp as a good example.
My only model looks like this:
As you can see, the model relates to itself. This lets nesting models into each one another.
The problem is that after i create a bunch of items and drag them into one another, data in local storage eventually ends up in an inconsistent state: parents do not correspond to children.
Here's my app's prototype: lolmaus/taskaparilla@bc67f44 (You need to run Ruby's
bundle install
in addition tobower install
andnpm install
).Start the app, create a handful of tasks, then drag them into one another. The app is configured to
.save()
on every drag. After a while of drag-and-dropping, refresh the page. You'll see that apps end up in a different order (if the order didn't change, do some more dragging and refresh again).Here's an example of a broken local storage content:
As you can see, task
Three
(id5nskn
) has taskTwo
(idmv0kq
) as parent, but taskTwo
does not have taskThree
as a child.This local storage content results in the following Ember Data hierarchy:
Now, if i drag
Two
intoThree
, local storage content will not change. This means that after i refresh the page, the hierarchy will revert to the previous state.I inspected the Ember Data content with Ember Inspector and discovered that after moving
Two
intoThree
, Ember Data content is consistent. All parents correspond to children correctly.Please confirm whether this is a legit bug.
The text was updated successfully, but these errors were encountered: