Comments (9)
Quick follow-up on this. After tracing with the debugger, it seems clear that there's a call to reifyClientId on Social.User which processes through properly (with model being in scope on 2750), but there's a second call to reifyClientId where things don't work, and the model variable is null on line 2750. I'm probably doing something incorrect in my routing, which died quietly under ember-model but not so under epf.
from epf.
#32 is about about reserved words.
from epf.
Is your server returning the proper JSON with the id field populated?
from epf.
Yeah, as far as I can tell there's some sort of error involved in pulling single values out of the REST adapter (and it could easily be an error on my part, because this seems like reasonably-common behavior). I'm easily able to pull everything in /api/nouns and do an {{#each noun}}{{name}}{{/each}} construct, but if I do a /api/nouns/1 by calling @session.find 'noun', 1 instead of @session.query 'noun', I end up with the error in creating client_id strings.
Rather than pursue this bug at this time, I've reverted back to ember-data for now.
from epf.
From the docs, loading an individual model is done as follows:
App.PostRoute = Ember.Route.extend({
model: function(params) {
return App.Post.find(params.post_id);
}
});
App.PostRoute = Ember.Route.extend({
model: function(params) {
return this.session.load('post', params.post_id);
}
});
from epf.
yeah, that's what I'm doing - @session.load 'user' 1 is equivalent to the return this.session.load('post', params.post_id); in your response.
I'm pretty sure my server is returning reasonable JSON - it's formatted using activemodelserializers, and can be digested in list-form by EPF and in singular form by ember-data and ember-model. I also experimented with pushing client_id as a property (by defining it on the serializer and verifying it changed in the API). I can clearly see the query going to rails, but for some reason things fail when establishing a client_id on a new object. Go figure.
from epf.
Aha, I figured it out - there was a combination of errors that looked similar, so I was conflating them.
First of all, if the serialized JSON object doesn't have an id field named id, it breaks. This is reasonable, and was the root cause of most of my errors - I couldn't deserialize the object because it was looking for a non-existant id.
The other problem is more serious, and maybe I'll open a new issue to document it, and it has to do with non-numeric routing IDs.
I am routing /api/users/:user_id with server logic so that /api/users/NUMBER shows a record, which is pretty standard, but also routing /api/users/current to the current user (as determined by the session cookie). This throws the same to_string error on client id as before, and I imagine it has something to do with the non-numeric value being passed to the query string.
from epf.
hmm I am very interested in getting to the bottom of your second issue. I think the issue with /api/users/current
is that it thinks current
is the ID which in fact is not.
from epf.
Is this still an issue? Lots has changed, I will reopen if this has not been fixed.
from epf.
Related Issues (20)
- Ep.IdSerializer can break with mongodb HOT 3
- typeKey seems incompatible with non-global Ember HOT 1
- Epf conflict with Ember.SimpleAuth HOT 6
- stricter jqXHR check
- Add `session.persist` HOT 1
- Testing EPF on ember-cli? HOT 6
- how to handle server error 500 on Model.find?
- Slow performance with 100 children HOT 5
- Using with ember-cli? HOT 6
- Still Alive? HOT 2
- Question: Embedded Documents HOT 24
- Embedded Update Error HOT 20
- Must be attached to a session. HOT 3
- Can't build distributable HOT 2
- Sideloading? HOT 6
- api documentation HOT 1
- Can't have belongsTo relation to work... HOT 2
- Delete parent model instance update children HOT 3
- Offline / network issues?
- Is the project dead? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from epf.