-
-
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
peekAll contains null entries after unloadRecord #5111
Comments
We just ran into a bug today where this happened in our application. Edit: I think it's ultimately related to #5025 and others. But this is a different use case, so it should be left open IMO. |
I think a similar to fix to the others can be applied here. Specifically, A failing test would be handy. |
@stefanpenner Failing test: #5157 |
I have the same bug, but in a little different situation: // /routes/courses.js
model() {
return this.store.peekAll('course');
}
// /controllers/courses.js
draftCourses: computed('[email protected]', function() {
return this.get('model').filterBy('isDraft');
})
// anywhere
store.unloadAll();
Versions: In addition, when I trying to enter
|
Similar error as @nag5000. But, In model computed property. |
I submitted a failing test for this issue, #5157. Would it be possible to have this relabeled as a bug? |
Getting mostly the same in similar conditions. Similar to #5167
'hello' looks very confusing and it's written that way in code.. and "Error: a glimmer transaction was begun, but one already exists. You may have a nested transaction" right after the previous message. |
thanks for the failing test @workmanw, sorry I have been a tad busy to look into this further. But it it is on my radar, if by this weekend I haven't responded, please feel free to ping me :) |
@stefanpenner Pinging you back :). To be honest, while this issue did impact our application, there are some clear workarounds we could take. However, we seem to be unable to come up with a workaround for issue: #5136. Sorry to hijack one issue to lobby for help with another. It's just the place our app finds itself in at the moment. |
The workarounds don't quire work if you use computed properties since they recompute before the second step can be performed. I'm still stuck on ED 2.12 even though i'm on Ember source 2.16. The farther i fall behind the more concerning this becomes.. |
@stefanpenner Any updates on that? Thank you very much |
Can't go any further with ember data until this is resolved. Anything i can do to help? |
What i've founded as workaround is to don't unload the records you are going to fetch again. |
Not really. My app lives long and the only way it prospers is if I run a garbage collection of sorts on records not currently in use.
By long I mean anywhere from 20 minutes to 24 hours and that’s only because I force a page reload every 24 hours.😏
… On Nov 20, 2017, at 10:25 PM, Sergi Ferran ***@***.***> wrote:
What i've founded as workaround is to don't unload the records you are going to fetch again.
I was doing unloadAll and then findAll. Some records were the same and then it crashed because of that. What i do now is to fetch the new records and unload only the ones that there aren't in the new bulk of data.
Hope this help to you.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
We have not been able to upgrade past 2.12.2 because this and issues like it that manifest in different ways and workarounds do not seem resolve the issue when using the embedded records mixin |
I have the same issue tested with ED 2.16.3 and 2.13.2, when creating a new model that
|
This still appears to be an issue in 2.18, any update on what release will have these issues addressed? |
At this point, it's best to assume it'll never be fixed and find your own workarounds. Ember-data allowed major regressions to be released in 9 months ago, despite reports from users during the beta cycle. And since little has done remedy it. Honestly the whole community would benefit greatly from abandonment of this addon. It would open the door for real competition and innovation in this space. As long as |
Has anybody found an actual workaround to "I want to delete all the data in the store" without using unloadAll? |
@AlexanderBanks - I have not, and I'm pretty [redacted explitive] frustrated by it at this point. Did you find a solution? |
@JBoshart No, we' switched over to a horrible hack to get around breaking the app via |
@AlexanderBanks - Thanks for your prompt response, I appreciate it. I'll post back here if I find a workaround. |
I almost thought i had progress here: #5025 I think figuring this out for real is going to take a epic journey down the rabbit hole. |
I discovered in the adapter that findAll was returning the correct payload, but when it got to my route it shoved the payload onto the end of the store (which never unloaded, and thus had a bunch of records I did not want). I ended up continuing to use findAll to make my api call, passed a piece of identifying data through with the response in the adapter, and then added the identifying key to each record in the payload. When the data got to my route I filtered the records based on that identifying key, and then set it on the controller as an array of objects, abandoning use of the store. Real pain in the butt, and not an elegant work around, but there you go. |
@Kilowhisky Never saw peekRecord returning null values though. It worked for me in 2.17 and 2.18. |
It seems to be fixed in 3.0.1 and 2.18.1 (#5273). I just upgraded to 3.0, everything is fine. |
Really??? Any idea what was done to fix it? I’m going to be working on migrating in the next couple weeks. |
So on 3.0.0 this particular issue (relating to peekAll containing null) appears to be fixed. Unfortunately this issue seems related and is happening to me: #5343 Also i'm still getting computed properties holding onto the models after they are destroyed and issuing errors like this.
If i remember this was how it worked in 2.16+ So not really any progress here. |
@Kilowhisky did you try the beta release ? If so, and it does not work, I know @jlami is trying to figure out the issue in #5354, maybe you could be interrested ? |
I'll be looking into whether #5378 fixes this issue, I suspect it does. |
I can confirm that #5378 will resolve this issue. |
Sorry for the late reply, i was out of country. I can confirm as well that #5378 this particular issue. EDIT: SPOKE too soon. Still causes the |
Hi, Is there any resolution/workaround for this one - Cannot update watchers for model after it has been destroyed. I am working on Ember-data - 2.18 |
This is related to #4963 and #5025 (probably). #4963 affected me though that exact issue appears to have been resolved. I'm thinking that #4963 was hiding #5025 from me before. Now i'm upgrading to 2.14.9 from 2.12 and i'm getting another issue.
This code is run after i unload a number of records from the store.
the
sortBy('utc')
fails because the peekAll record array still contains references to unloaded records.If this is too close to those other issues please close.
EDIT:
For show:
This outputs
1844
and700
. Big difference.The text was updated successfully, but these errors were encountered: