-
-
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
v1.0.0-beta.16.1 (and canary) - error after willDestroy #2988
Comments
You are trying to find something after you destroyed the store? It seems ok that it errors out. Why are you trying to do this? |
I use After this I use the Login for a new user and get this error (I call this.store.find('user') after login). With v1.0.0-beta.15 this works as expected. |
|
Thanks for the quick response. If I change it to unloadAll I get this error:
In auth-manager 185 is this: |
@svox1 You have to provide a |
Ah sorry for that... that was the reason why I have study the ember-data code and used willDestroy because I didnt want to manually remove each model. Here I was asking this question: What a pity that this doesnt work anymore with v1.0.0-beta.16.1 |
I found a "fix". Can you please change the line: delete this._containerCache; To: this._containerCache = Ember.create(null); After that, everything is clean and I can use willDestroy(); Update |
I think instead of messing with willDestroy, we should provide a method that clears all data, which iterates over the types and calls |
Gladly, but I doesn't know enough about the internal ember-data handling. this.recordArrayManager.destroy(); and the containerCache? for (var cacheKey in this._containerCache) {
this._containerCache[cacheKey].destroy();
delete this._containerCache[cacheKey];
}
delete this._containerCache; Maybe this is enough: // reset or better clear or unloadAll and make parameter 'type' optional because I think unloadAll is the right name for this?
reset: function() {
var typeMaps = this.typeMaps;
var keys = Ember.keys(typeMaps);
var types = map(keys, byType);
forEach(types, this.unloadAll, this);
function byType(entry) {
return typeMaps[entry]['type'];
}
}, And maybe we can call this.reset(); in willDestroy(); if the order of the call this.recordArrayManager.destroy(); is not important. Sorry Im not familiar with the ember-data code... Iam only a consumer ;) |
You're on the right track! Move the parts responsible for unloading all types to a separate function ( I agree that Feel free to ping me on IRC, I'd be happy to help. |
change unloadAll behavior to: unload all data in the store Related discussion emberjs#2988
… after willDestroy)" This reverts commit 2b599ad.
change unloadAll behavior to: unload all data in the store Related discussion emberjs#2988 Revert "fix issue emberjs#2988 (v1.0.0-beta.16.1 (and canary) - error after willDestroy)" This reverts commit 2b599ad.
change unloadAll behavior to: unload all data in the store Related discussion emberjs#2988 Revert "fix issue emberjs#2988 (v1.0.0-beta.16.1 (and canary) - error after willDestroy)" This reverts commit 2b599ad.
change unloadAll behavior to: unload all data in the store Related discussion emberjs#2988 Revert "fix issue emberjs#2988 (v1.0.0-beta.16.1 (and canary) - error after willDestroy)" This reverts commit 2b599ad.
change unloadAll behavior to: unload all data in the store Related discussion emberjs#2988
…or of unloadType(type)e Related discussion emberjs#2988
Ember-cli 0.2.3
Ember 1.12.0-beta.1
With v1.0.0-beta.15 everything works finde.
With v1.0.0-beta.16.1 I get an error after call
If I try to make a request:
I get the error:
Uncaught TypeError: Cannot read property 'adapter:user' of undefinedstore.js:1901 ember$data$lib$system$store$$Service.extend.retrieveManagedInstancestore.js:1914 ember$data$lib$system$store$$Service.extend.lookupAdapterstore.js:1831 ember$data$lib$system$store$$Service.extend.adapterForstore.js:702 ember$data$lib$system$store$$Service.extend._flushPendingFetchForTypeember.debug.js:13590 Map.forEach.cbember.debug.js:13387 OrderedSet.forEachember.debug.js:13598 Map.forEachstore.js:696 ember$data$lib$system$store$$Service.extend.flushAllPendingFetchesember.debug.js:878 Queue.invokeember.debug.js:943 Queue.flushember.debug.js:748 DeferredActionQueues.flushember.debug.js:173 Backburner.endember.debug.js:576 (anonymous function)
The text was updated successfully, but these errors were encountered: