Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent expiration behaviour for memory storage when replacing #23

Closed
instanceofme opened this issue Sep 16, 2011 · 2 comments
Closed
Labels

Comments

@instanceofme
Copy link
Contributor

@instanceofme instanceofme commented Sep 16, 2011

With*Storage and userData, if I replace a previously-expirable value and don't set an expiration, there is no expiration (which is the behavior I expect). With memory storage however, the first expiration will delete the replaced value (the setTimeout is not cleared).

amplify.store[type]( 'key', 'value1', {expires: 500} );
amplify.store[type]( 'key', 'value2' );
window.setTimeout( function(){ alert( amplify.store[type]( 'key' ) ) }, 1000 );

This JsFiddle tests all storage types available to the current browser.

@instanceofme
Copy link
Contributor Author

@instanceofme instanceofme commented Sep 16, 2011

Fix proposal in pull request #24, I don't know if you can merge those discussions…

@scottgonzalez
Copy link
Contributor

@scottgonzalez scottgonzalez commented Sep 16, 2011

I didn't want that commit to close this ticket. I just wanted to post my suggested fix to start a discussion with @streetpc. I guess next time I'll have to do it from my own account...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants