entangled icon indicating copy to clipboard operation
entangled copied to clipboard

Duplicate items in the collection

Open ollieh-m opened this issue 7 years ago • 3 comments

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!

ollieh-m avatar Sep 03 '16 11:09 ollieh-m

This is very interesting - let me have a look.

dchacke avatar Sep 06 '16 05:09 dchacke

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.

dchacke avatar Sep 06 '16 06:09 dchacke

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.

ollieh-m avatar Sep 11 '16 14:09 ollieh-m