tymondesigns / angular-locker

🗄️ A simple & configurable abstraction for local/session storage in angular js projects
https://npm.im/angular-locker
MIT License
314 stars 42 forks source link

fix compatibility with latest Chrome v60.0.3080.5 #38

Closed stephen79 closed 7 years ago

stephen79 commented 7 years ago

D2NOVA Stephen Chen In latest Chrome on MacOS (Version 60.0.3080.5) the angular-locker 2.0.4 will fail to read from localStorage. i.e. locker.get(mykey) will return undefined even there is data stored with the key 'mykey' the root cause is that in _exists() method

this._driver.hasOwnProperty(this._getPrefix(_value(key)))

is not working for this Chrome.

so the fix to that is to change to :

this._driver.hasOwnProperty(this._getPrefix(_value(key))) || this._getItem(key)

tymondesigns commented 7 years ago

Since Chrome 60 is Chrome Canary, I would rather wait until it becomes a stable release before addressing this issue. I will check it out myself nonetheless though. Thanks!

ajoslin103 commented 7 years ago

can we get a merge on this? this is breaking my development environment

simison commented 7 years ago

FYI, @tymondesigns Chrome v60 is in dev now.

https://www.chromestatus.com/features#milestone%3D60

ajoslin103 commented 7 years ago

yes, sorry - I realized that after the fact. I've brought my dev down to stable.

thanks!

Ranumao commented 7 years ago

FYI, Chrome v60 is in beta now.

tymondesigns commented 7 years ago

Thanks

tymondesigns commented 7 years ago

By the way.. it seems to work without this fix in the latest Chrome Canary (61.0.3130.0)

Has anyone seen this logged as a bug?

simison commented 7 years ago

Has anyone seen this logged as a bug?

In Chrome? I was trying to look into it but couldn't find anything. Chrome core is pretty huge project tho so not a big surprise: perhaps asking on their forum or IRC would help tho.

simison commented 7 years ago

@tymondesigns wanna bake a new release? :-)

tymondesigns commented 7 years ago

Yea i'll add one soon

tymondesigns commented 7 years ago

Release tagged 2.0.5

simison commented 7 years ago

Great, much love and support to your way!