There are two parts to this post - the first is what this chain was previously about, the second regarding what munder asked above.
I tried many things on this, and what worked for me was to only sync the stores on window unload. I added the following in Main.launch:
and for the unload,
window.onbeforeunload = this.handleWindowBeforeUnload;
Currently my solution is not duplicating any entries as it seemed that the duplication only came when saving the records. And only saving it once seems to work around that. It could well be that there are other fixes in the many that I tried that linger on in my project and they are contributing, but this was the last piece that i added which stopped the problem.
--- 2 ---
I recommend looping through all the records and adding them to your store, and then calling sync(). As mentioned above, each modification of a local storage record seems to cause duplication. Cannot say precisely why your approach is duping, but there it is. So your original code was better (for performance reasons as well), but what you may need to do is declare the record "dirty" for the sync to properly save it.