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

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
Labels

Comments

@dcneiner
Copy link
Contributor

@dcneiner 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
Copy link

@dragthor dragthor commented Jun 6, 2011

All browsers?

@scottgonzalez
Copy link
Contributor

@scottgonzalez scottgonzalez commented Jun 7, 2011

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

@scottgonzalez
Copy link
Contributor

@scottgonzalez scottgonzalez commented Jun 7, 2011

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 added a commit that referenced this issue Jun 7, 2011
…r in-memory data. Partial fix for #16 - Cannot use Amplify.store reliably when page is open in more than one browser tab/window.
@ghost ghost assigned scottgonzalez Jun 7, 2011
scottgonzalez added a commit that referenced this issue Jun 7, 2011
…e Amplify.store reliably when page is open in more than one browser tab/window.
@scottgonzalez
Copy link
Contributor

@scottgonzalez scottgonzalez commented Jun 7, 2011

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 added a commit that referenced this issue Jun 7, 2011
… last issue with #16 - Cannot use Amplify.store reliably when page is open in more than one browser tab/window.
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
3 participants