Backbone.localStorage icon indicating copy to clipboard operation
Backbone.localStorage copied to clipboard

Not fetching all models from collection

Open dottodot opened this issue 10 years ago • 4 comments

In my Backbone Marionette app I'm adding items to the localstorage successfully but it's not returning all the models.

In my case an item is added to my cart collection and this takes you to the cart page which should list all the items in the cart. The first item added works but when a second item is added and you are taken to the cart only the latest one show.

This also only seems to happen when navigating to the cart page using a trigger, if I cmd + R refresh the page the full collection is returned.

Bit confused as to what is going on.

dottodot avatar Oct 21 '14 11:10 dottodot

OK I've found that if I set an id rather than using the guid it works as it should, sometimes i.e about 50%

dottodot avatar Oct 21 '14 18:10 dottodot

Having the same problem, this seems to be random, sometimes, the full collection is returned, some other time, just a part of it. The full collection is in local storage. As dotdotdot mentionned, reloading the page the full collection is returned.

nddery avatar Jul 31 '15 16:07 nddery

Same here, i've a collection. I add a model in it. Seems good on the View, I switch to an another view, fetch the collection, new models are missing. But if i refresh the page, my new models are here ....

EDIT : the remove works properly, but new items are missing. I must be doing wrong the add method...

munvier avatar Mar 06 '16 18:03 munvier

Looks like is the same as #177

yahuarkuntur avatar Jun 12 '18 01:06 yahuarkuntur