Skip to content
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

(blog example)multiple comments real time synchronization #38

Closed
yial2 opened this issue Apr 8, 2014 · 6 comments
Closed

(blog example)multiple comments real time synchronization #38

yial2 opened this issue Apr 8, 2014 · 6 comments

Comments

@yial2
Copy link

yial2 commented Apr 8, 2014

Assuming I have a post with ID 123:
I have the post open in firefox, and I also have the same post open in chrome.

When I add a comment for the post in chrome, I was under the assumption that the same post in firefox should show the newly added comment at "almost" real-time, but it does not seem to work at all. I will have to refresh the page to see the newly added comment.

Is this by design or there are more works needed in order to get the hasMany relationship to update/synch properly?

@mbykovskyy
Copy link

I see this behavior as well sporadically.

@aputinski
Copy link
Collaborator

@yial2 @mbykovskyy The relationship is supposed to update in realtime, so I'll take a look and see what's going on.

@mbykovskyy
Copy link

@aputinski It's a strange one. I noticed that the view in a session that creates a record only updates once. The second client doesn't update at all. It looks like emberFire gets all the data and it pushes it to the store but the view doesn't get notified.

It could be because of what route returns as a model. Originally I had it return this.modelFor('post').get('comments') but changing it to this.store.find('comment') makes it work! The only thing is that it returns all comments as opposed to comments that belong to the post.

@yial2 What do you return in the route for the model?

@yial2
Copy link
Author

yial2 commented Apr 14, 2014

@mbykovskyy return this.store.find('post', params.post_id);
I downloaded the exact code from the repositories without changing anything.

@mbykovskyy
Copy link

Ok I'm seeing a different problem then but it could be because in the route I'm not actually returning a model but its attribute.

@aputinski
Copy link
Collaborator

@yial2 this should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants