Cannot use Amplify.store reliably when page is open in more than one browser tab/window #16

Closed
dcneiner opened this Issue Jun 4, 2011 · 4 comments

Projects

None yet

3 participants

@dcneiner
Contributor
dcneiner commented Jun 4, 2011

Amplify.store starts "losing" data when it is in use on more than one browser tab for the same website. It seems that whichever tab/window writes last keeps its data, but the unlucky tab that didn't write last loses its data.

@dragthor
dragthor commented Jun 6, 2011

All browsers?

@scottgonzalez
Contributor

Yeah, all browsers. This happens because we cache the keys on page load to deal with various annoyances.

@scottgonzalez
Contributor

The fix for this is going to result in existing stores having an extra item. The key will be an empty string and the value will be an array of all previous keys. We'll need to document how to remove this in the release notes.

@scottgonzalez scottgonzalez added a commit that referenced this issue Jun 7, 2011
@scottgonzalez scottgonzalez Store: Don't cache keys for Storage interfaces. Use a custom store fo…
…r in-memory data. Partial fix for #16 - Cannot use Amplify.store reliably when page is open in more than one browser tab/window.
da0feef
@scottgonzalez scottgonzalez was assigned Jun 7, 2011
@scottgonzalez scottgonzalez added a commit that referenced this issue Jun 7, 2011
@scottgonzalez scottgonzalez Store: Don't cache keys for userData. Partial fix for #16 - Cannot us…
…e Amplify.store reliably when page is open in more than one browser tab/window.
b818692
@scottgonzalez
Contributor

This should be working properly for all storage types now. However, the new implementation for getting all values is wrong if there are any expired values. We're looping through a live array, so removing expired values changes the indexing so we're losing values. This needs to be tested and fixed before this issue can be closed.

@scottgonzalez scottgonzalez added a commit that referenced this issue Jun 7, 2011
@scottgonzalez scottgonzalez Store: Proper handling of expired data when getting all values. Fixes…
… last issue with #16 - Cannot use Amplify.store reliably when page is open in more than one browser tab/window.
ceb3b35
@scottgonzalez scottgonzalez was unassigned by dcneiner Mar 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment