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.
Yeah, all browsers. This happens because we cache the keys on page load to deal with various annoyances.
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.
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.
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.
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.
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.