Inconsistent expiration behaviour for memory storage when replacing #23

Closed
instanceofme opened this Issue Sep 16, 2011 · 2 comments

Projects

None yet

2 participants

@instanceofme
Contributor

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
Contributor

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

@scottgonzalez scottgonzalez reopened this Sep 16, 2011
@scottgonzalez
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...

@scottgonzalez scottgonzalez added a commit that closed this issue Sep 16, 2011
@instanceofme @scottgonzalez instanceofme + scottgonzalez Store: When setting a value in memory, clear any previous timeout. Fi…
…xes #23 - Inconsistent expiration behaviour for memory storage when replacing.
daa5012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment