When I upgraded angular-cache from 2.3.0 to 2.3.1, I noticed after my cache in localStorage would expire that I would get errors when angular-cache attempted to parse the cache. I reverted to 2.3.0 and the problem vanished. Here's a plunker that shows the issue (I can repro on Firefox/Chrome):
What seems to be happening is after the cache expires, it writes "undefined" to the local storage and it attempts to call JSON.parse on the undefined string, causing a syntax error.
Is this a regression or did something change in the API and I need to change my implementation?
When I upgraded angular-cache from 2.3.0 to 2.3.1, I noticed after my cache in localStorage would expire that I would get errors when angular-cache attempted to parse the cache. I reverted to 2.3.0 and the problem vanished. Here's a plunker that shows the issue (I can repro on Firefox/Chrome):
http://plnkr.co/edit/PoXRGBvetOh1zYyhAV6e
What seems to be happening is after the cache expires, it writes "undefined" to the local storage and it attempts to call JSON.parse on the undefined string, causing a syntax error.
Is this a regression or did something change in the API and I need to change my implementation?