-
Notifications
You must be signed in to change notification settings - Fork 731
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
Realm migration bg #6548
Realm migration bg #6548
Conversation
if (intent.hasExtra(EXTRA_NEXT_INTENT)) { | ||
// Start the next Activity | ||
val nextIntent = intent.getParcelableExtra<Intent>(EXTRA_NEXT_INTENT) | ||
startIntentAndFinish(nextIntent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is working but when going back, we can see the MainActivity screen for a few ms...
9ec5de1
to
ef41a3d
Compare
e5c1c63
to
7288f37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 small remarks, otherwise LGTM. Not tested.
private fun startPollingActiveSession() { | ||
globalScope.launch { | ||
do { | ||
delay(1.seconds.inWholeMilliseconds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a listener to tell when the session is ready instead of polling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it, but I think this is not necessary because it will make the ActiveSessionHolder
more complex for not real added value
clearNotifications() | ||
|
||
startAppViewModel.onEach { | ||
renderState(it) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will refresh the UI every second, maybe not necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, at the beginning I wanted to add more complex UI (timer, different wording depending on the duration, etc.). I may iterate on this, but honestly does it really worth it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done it in 912d71b
912d71b
to
6314a2f
Compare
OK. I have dropped the tmp commit and added a file for the changelog. |
…rApplication to unblock the main thread. This fix is not necessary anymore, since the session is restored either in `MainActivity` or in `VectorMessagingReceiver`. Ref: b7a54ea
It also fixes a crash when trying to share to the app if there is no active session: `IncomingShareViewModel` injects the `session` in the constructor.
cb73cfa
to
b83f6f2
Compare
SonarCloud Quality Gate failed. |
This PR tries to move the Realm migration DB into background.
The first commit ensure there is always a migration to do and the migration will last 5 minutes. To be dropped of course.
VectorApplication.onCreate()
MainActivity
view modelNew design with a wording (will iterate with @ganfra ):
Before we can have ANR if the migration takes time. After this should not happen anymore.
I create the PR to make this work public.
There are still some limitations:
TODO This will not work, handle this case.