Implement persistent room ids for PWAs#10
Open
schlagmichdoch wants to merge 5 commits into
Open
Conversation
…onStorage is empty or undefined
…ly method on PersistentStorage.set(key, value)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements indexedDB to make rooms persistent.
When the tab is closed the room id is saved in a indexedDB store and is retrieved when the page is loaded again.
This way the user does not have to enter the room manually everytime the page is loaded.
When the room is left the room id is deleted in store.
This is especially useful with PWAs as entering a room with an url parameter as implemented with #9 is not suffienct with those. PWAs are always installed with a specific start url which can not be changed on installation.
With this PR merged, users can simply reopen their PWA to automatically enter the room they joined last.
As a secondary effect all instances opened in one browser after an instance entered a room are now opened automatically in the same room. This does not affect instances that are already in a room.