-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Loading belongsTo removes relationship for other instances #5706
Comments
@makepanic could you PR that test commit? |
@makepanic I realized that your report above is missing the |
i've seen it in ember-data The PR with failing ember-data tests is on current master which was |
I can confirm this in 3.4.2 as well. I switched back to 3.1.1 without issues. |
Waiting for emberjs/data#5706 to be fixed
I'm currently "bisecting" when this issue was introduced.
As the issue was introduced from 3.3.0 to 3.3.1 it's most likely caused by #5541 If one removes the added code from https://github.com/emberjs/data/pull/5541/files#diff-71266fb7fe629103f166f694e660e11aR685 it's ok again. This means that block of code is causing the issue. If one removes the |
If anyone stumbles over this, here's the last status of this (via discord):
|
Well, this was nasty -- this issue manifested as a random race condition in my app that's been driving me nuts all week. 9_6 Reading the above post and the linked RFC, I'm confused on what the state of this is. It's talking about a deprecation, but what's being deprecated, exactly? The current state of things is broken -- we need a fix, not a deprecation. :P For context, I was trying to adopt the Things technically work again now that I've gone back to [EDIT] Spoke too soon. Things are broken in very weird, other ways with |
I've rebased the failing test onto the latest master and noted that the "easy" workaround doesn't work anymore. It looks like the payload got normalized before reaching the This is caused by data calling I guess there are now more complex workarounds for this issue:
|
I've already checked if the PR solves the failing test when writing the last comment. I haven't have time to bisect it yet but it looks like changes to If I remove The tl;dr is basically (note incorrectly normalizing the data array): Should i create a new issue for the incorrect resource linkage normalization? |
I don't fully understand the relationship data fixing yet, but only doing it if I'm not really sure if it's a good idea though as it potentially introduces a regression that 5608 fixed. |
@makepanic the caveat is that an incorrect relationshipData payload would still be allowable then (the intent was to get to the point we would assert). That said, I trust the tests we added and if they pass with that change and you can add a test that covers the edge case we missed then I am all for it. Looking into things I think there are two bugs here: the first is that we don't merge payloads sometimes when we should during the fixing. The second is that sometimes the payload is going to be partial, and in that case we need a mechanism by which to apply the state to the store in a partial manner. This mechanism is coming in the form of operations over the next 6 months. |
Hi,
after upgrading to the most recent data version (3.1.1 -> 3.5.0), I'm seeing different behavior when retrieving a inverse relationship.
That is as soon as I call
instance.get('relationship')
then the relationship model can't be used from any other instance that has the same relationship.Setup
Given 2 models:
Where:
Reproduction
The issue sounds related to what #5608 already fixed.
Versions
Run the following command and paste the output below:
npm ls ember-source && npm ls ember-cli && npm ls ember-data
.The text was updated successfully, but these errors were encountered: