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

Update Information Flow documentation to mention Service Worker <-> Browser State communication and data exchange #2477

Open
taoeffect opened this issue Dec 22, 2024 · 0 comments

Comments

@taoeffect
Copy link
Member

taoeffect commented Dec 22, 2024

Problem

The Information Flow documentation doesn't mention some important details about how data is exchanged between the service worker and the open browser tabs.

Some of this is mentioned in the LOGIN_FLOW.md documentation, but it really needs to be elaborated on in the Information Flow documentation.

Solution

Describe in detail how, for example, periodic notifications work. For example, it's not clear that when the service worker posts a periodic notification as a push notification, that a separate in-app notification needs to be made, and that a message is sent to each browser tab to create the notifications, and each tab will update its own Vuex state, and then each tab will save that same Vuex state to disk. So if you have 7 tabs open, that's 7 writes of the Vuex state to disk, with all but the last one getting overwritten.

And explain why, for example, we don't write to one tab and have the others load that state (because then if one tab is pointed to one group, and another tab is open to another group, it would make all tabs point to the same group).

Discuss the difference between the Vuex state and the Chelonia state, and how the SW Chelonia state gets copied to the browser tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant