funkensturm / ember-local-storage

The addon provides a storageFor computed property that returns a proxy and persists the changes to localStorage or sessionStorage. It ships with an ember-data adapter.
https://www.funkensturm.com/ember-local-storage/
MIT License
218 stars 76 forks source link

fix chrome infinite storage loop bug #285

Open onumossn opened 6 years ago

onumossn commented 6 years ago

If you have multiple tabs open in Chrome and run the following in each tab

window.addEventListener('storage', (e) => {
  if(e.oldValue !== e.newValue) { window.localStorage['hi'] = e.newValue; }
})

and run

for (var i = 0; i < 2; i++) { window.localStorage['hi'] = i.toString()}

, it can get into an seemingly infinite loop after having it in a certain number of tabs. Its seems to be similar to #47.