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

Factor logic of what screens to display when out of MatrixChat #28121

Open
dbkr opened this issue Sep 30, 2024 · 0 comments
Open

Factor logic of what screens to display when out of MatrixChat #28121

dbkr opened this issue Sep 30, 2024 · 0 comments
Labels
A-Developer-Experience T-Task Tasks for the team like planning

Comments

@dbkr
Copy link
Member

dbkr commented Sep 30, 2024

Your use case

In writing element-hq/matrix-react-sdk#44 I changed MatrixChat to display the Complete Security screen after login under certain conditions and it caused everything to break horribly. There are so many screens that MatrixChat might show at different points under different conditions. Fortunately a good amount of them are covered by tests. Most of them are playwright but some are "unit" tests on MatrixChat (which are more integration tests because they essentially cause the whole app to be started).

It would be better to have a separate store class that decided what screen should be shown when, and decide it in one place. The current logic looks, I believe, something like this (albeit incomplete):

 matrixchat startInitSession
 matrixchat initSession -> might show some screens once done
 matrixchat loadSession -> might show some screens once done
 Lifecycle.loadSession();
 lifecycle restoreSessionFromStorage
 lifecycle doSetLoggedIn
------- OnLoggedIn fires here
 lifecycle startMatrixClient
 MatrixClientPeg.start
 MatrixClientPeg.assign
   MatrixClientPeg.initClientCrypto
     DOES MIGRATIONS
-------- login splash view needs to be shown BEFORE this point
-------- we now know whether we want to show complete security
 starts syncing
   push rules fetched
-------- now safe to show first time user flow
 start syncing
  - waits for get versions but not first/cached sync (I think)
 prepared
 syncing

Have you considered any alternatives?

No response

Additional context

No response

@dbkr dbkr added T-Task Tasks for the team like planning A-Developer-Experience labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Developer-Experience T-Task Tasks for the team like planning
Projects
None yet
Development

No branches or pull requests

1 participant