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

Duplicate items in the collection #239

Open
ollieh-m opened this issue Sep 3, 2016 · 3 comments
Open

Duplicate items in the collection #239

ollieh-m opened this issue Sep 3, 2016 · 3 comments

Comments

@ollieh-m
Copy link

ollieh-m commented Sep 3, 2016

When I create a new object, the collection of objects that gets pulled in by the client duplicates the new object, even though it is only created once in the database and on refreshing the client it only gets pulled in once.

I use .$save to create a new 'messageboard', and I use .all() to pull in all messageboards. The bug happens:

  • when I've gone into a particular messageboard (at /messageboards/:id) then gone back to the index - then when I create a new messageboard it appears two or three times in the collection of messageboards;
  • only in the client that has created the messageboard - in another browser the new messageboard only appears once;
  • because of something to do with what's being broadcast - I've done console.log() on the messageboards returned by .all() and the array includes the new messageboard two or three times, so the problem is to do with what's actually being broadcast, not how I'm displaying messageboards;

Here's the branch where the bug is happening - the angular app is in app/assets/javascripts

Other than this very strange issue, the gem's working great for me. Thank you!

@dchacke
Copy link
Owner

dchacke commented Sep 6, 2016

This is very interesting - let me have a look.

@dchacke
Copy link
Owner

dchacke commented Sep 6, 2016

Can you provide a branch that runs just plain old sqlite instead of postgres? I have a new computer on which I don't have postgres set up yet and it would take a little bit for me to set it up. Thanks in advance.

@ollieh-m
Copy link
Author

Here you are: https://github.com/ollieh-m/message-board-angular-rails-entangled/tree/message-board-mysql
I've checked on this branch and the same problem is happening. Any explanation or help would be really appreciated.

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

2 participants