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

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

This comment has been minimized.

Show comment
Hide comment
@dragthor

dragthor Jun 6, 2011

All browsers?

dragthor commented Jun 6, 2011

All browsers?

@scottgonzalez

This comment has been minimized.

Show comment
Hide comment
@scottgonzalez

scottgonzalez Jun 7, 2011

Contributor

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

Contributor

scottgonzalez commented Jun 7, 2011

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

@scottgonzalez

This comment has been minimized.

Show comment
Hide comment
@scottgonzalez

scottgonzalez Jun 7, 2011

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.

Contributor

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

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.

@ghost ghost assigned scottgonzalez Jun 7, 2011

scottgonzalez added a commit that referenced this issue Jun 7, 2011

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

This comment has been minimized.

Show comment
Hide comment
@scottgonzalez

scottgonzalez Jun 7, 2011

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.

Contributor

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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment