-
-
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
Records not found in a coalescing request are created and left loading forever #4463
Comments
We are rejecting the loading promise, but I'm not sure that rejection is being handled to transition the state away from loading anywhere. cc @pangratz |
@dgaus can you check if this is still an issue on master? I cleaned up a lot of the data flow in that area and we may have nicely gotten a win on this because of it. |
@runspired Thanks for the reply, however I installed emberjs/data#master (2.12.0-canary+a1bac10f3a) on Ember 2.9.1 and it is still an issue. I couldn't try ember#master since my app broke. |
@dgaus thanks! that lets me know it's still an issue, will add this to my TODO list :) |
@runspired I seem to have this issue. To see it in action
|
I have a simple reproduction of this problem here: https://github.com/jlami/ember-bug-empty-data The findRecord does have the unloadRecord in https://github.com/emberjs/data/blob/master/addon/-private/system/store/finders.js#L49 |
@runspired I use the |
Just tested with ember-data 2.11.0 and the bug is not solved.
|
@runspired I will temporary set |
Another issue with (I think) the same root cause: if you try to do a |
+1 experienced this issue today also |
I've also encountered this issue because our back-end was simply omitting records that the current user in our application doesn't have permissions to see. While it looks like we'll be able to come up with a solution on our back-end, what I think would help is the ability to customize the handling of the While turning off record coalescing is part of a work-around for now, it does significantly slow down the requests for us. |
we can likely clean up this behavior without introducing any new hooks, just by passing the correct Errors through and cleaning up the state of the records. |
In the past didn't we just silently ignore missing records? I think the permissions use case that @scudmissile described is pretty valid. If I make a request for ids 1,2,3 and the server returns only 1 and 2, I would think that could be handled in application code, rather than framework code. |
Is there a workaround for this ATM? Running into this on 3.12 |
You can wrap all your findRecords into an |
Thanks! I don't think that'll work for our use case, since we're relying on async loading across a variety of components on the page. At this point I think we may just inject the missing records in the adapter's |
The move to REQUEST_MANAGER (active on master) means that this is far easier to resolve now from the error threading perspective. On the cleanup front, the move to identifiers means we'll be eliminating most of the behaviors around unload retaining state since we no longer need these objects as references. Rejecting the appropriate requests from the findMany call would be a good starter PR for someone looking to contribute. |
Missing records are now properly rejected. #8113 cleaned up this rejection. Removal of InternalModel in #8084 and associated improvements to teardown, coupled with the removal of the state machine mean that this should not only no longer be an issue, but that also any rejections should be resolvable by application code. Happy to open a new issue for a specific case if one presents itself. |
Is there any way to make this not an error? It definitely seems like we should be able to not throw when we get some things back and not others. |
Hi, on ember-data 2.6.1 I'm issuing several .finds which get coalesced into one request. If any of them do not exist on the server I get a
WARNING: Ember Data expected to find records with the following ids in the adapter response but they were missing: [xx, ...]
.However if later I try to create a record with any of those IDs, it fails because
The id xx has already been used with another record of type ...
.Then
obj = store.peekAll('model').findBy('id', 'xx').get('isLoading') === true
, and I cannot do anything about it, including deleting it, because its state is 'loading'.I am also using ember-django-adapter, so I am unsure if I should report it there, please let me know if you think it's their issue instead of ember-data's. Thanks
The text was updated successfully, but these errors were encountered: