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

Comments

Projects
None yet
2 participants
@instanceofme
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@instanceofme

instanceofme Sep 16, 2011

Contributor

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

Contributor

instanceofme commented Sep 16, 2011

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

@scottgonzalez

This comment has been minimized.

Show comment
Hide comment
@scottgonzalez

scottgonzalez Sep 16, 2011

Contributor

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...

Contributor

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