Sign in with element classic final#6296
Conversation
01673ce to
8abb802
Compare
|
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #6296 +/- ##
===========================================
+ Coverage 81.02% 81.04% +0.02%
===========================================
Files 2596 2608 +12
Lines 71726 72098 +372
Branches 9288 9337 +49
===========================================
+ Hits 58114 58432 +318
- Misses 10199 10236 +37
- Partials 3413 3430 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
10f8556 to
7927b17
Compare
52a59e8 to
436113a
Compare
f39687d to
73e1a09
Compare
Ensure that the timeout has effect only in Idle state.
676c11c to
f5e1cbe
Compare
jmartinesp
left a comment
There was a problem hiding this comment.
Some minor comments about the code, just nitpicks so feel free to ignore them.
I'll give it another check with the IDE later and then test it. How should I test this, btw? Do I need versions of EXA and EA signed with some specific keys?
| // Do not emit error, else the regular on boarding flow will be displayed | ||
| // emitState(ElementClassicConnectionState.Error("The messenger is null, can't request data")) |
There was a problem hiding this comment.
Should this still be around?
| @ContributesBinding(AppScope::class) | ||
| @SingleIn(AppScope::class) | ||
| class DefaultElementClassicConnection( |
There was a problem hiding this comment.
Maybe some diagram or explanation of how the flow should happen would be helpful as docs.
| } | ||
|
|
||
| override fun start() { | ||
| Timber.tag(loggerTag.value).w("start()") |
There was a problem hiding this comment.
Should this be a debug log now?
| private val mutableStateFlow = MutableStateFlow<ElementClassicConnectionState>(ElementClassicConnectionState.Idle) | ||
| override val stateFlow = mutableStateFlow.asStateFlow() |
There was a problem hiding this comment.
Nit: should this be at the start of this component?
There was a problem hiding this comment.
Is using a getter better to you?
get() = mutableStateFlow.asStateFlow()
There was a problem hiding this comment.
Oh, I just meant other properties are at the top of the component (~L75), so this should probably be there too?
There was a problem hiding this comment.
Sure. I was confused because this class has a fun start() 😅
| private fun getElementClassicComponent() = ComponentName( | ||
| BuildConfig.elementClassicPackage, | ||
| ELEMENT_CLASSIC_SERVICE_FULL_CLASS_NAME, | ||
| ) |
There was a problem hiding this comment.
Nit: this could probably be a val instead?
There was a problem hiding this comment.
Oh yes, the function was different before.
The code should run with debug versions and release version of the applications (EC debug <-> EX debug) and (EC release <-> EX release). But I need to check if nightly build could communicate together I do not think this is the case. You can install Element Classic from develop (now that element-hq/element-android#9136 has been merged) and EX from this branch (using diawi QR code should be OK) |
jmartinesp
left a comment
There was a problem hiding this comment.
It works really well! Just a couple of things I noticed:
- I had a couple of sessions on EXA that I've been using for a while (so multi-account enabled). When I logged out of both accounts to test this, EXA wouldn't display the new screen to use EA's session data. After I cleared the app's data this was working, so maybe the logout didn't get rid of some data in the local DBs and case 4 happened, where EXA thought it didn't need to display anything because the same session already existed? Or maybe it was the force-kill that helped with this? It's not a blocking issue IMO, and I can't reproduce it anymore.
- Another weird thing I experienced is I had EA with an account without key storage and EXA already opened in the initial screen. I then verified EA and went back to EXA, and when trying to log in it still asked me to verify my account, maybe because the session data had been shared before I verified EA (in the new initial screen)? Restarting the app used the right flow and I was logged in and verified directly.
|
For point 1, I am not sure what happened. |
This ensure that Element X is always up to date regarding Element Classic state.
|
Thanks @jmartinesp. I have added fd3c4c2 that should ensure that Element X is always up to date with Element Classic. So now:
I have also checked that there is no regression when the screen to go and enable key backup on Element Classic is displayed. Also this change is simplifying the code, so all good! |
|
| private val slider: ModifierTransitionHandler<LoginFlowNode.NavTarget, BackStack.State>, | ||
| private val fader: ModifierTransitionHandler<LoginFlowNode.NavTarget, BackStack.State>, | ||
| ) : ModifierTransitionHandler<LoginFlowNode.NavTarget, BackStack.State>() { | ||
| override fun createModifier( |
There was a problem hiding this comment.
⚠️ Modifier factory functions should be extensions on Modifier
| * Handler of incoming messages from service. | ||
| */ | ||
| @Suppress("DEPRECATION") | ||
| inner class IncomingHandler : Handler() { |
There was a problem hiding this comment.
⚠️ ThisHandlerclass should be static or leaks might occur (io.element.android.features.login.impl.classic.DefaultElementClassicConnection.IncomingHandler)
| private val slider: ModifierTransitionHandler<NavTarget, BackStack.State>, | ||
| private val fader: ModifierTransitionHandler<NavTarget, BackStack.State>, | ||
| ) : ModifierTransitionHandler<NavTarget, BackStack.State>() { | ||
| override fun createModifier( |
There was a problem hiding this comment.
⚠️ Modifier factory functions should be extensions on Modifier



Content
Let Element X import details from any existing session from Element Classic to sign in and verify the session automatically.
Note: require element-hq/element-android#9136 to merged and released.
Motivation and context
Help users of Element Classic migrate smoothly to Element X.
Screenshots / GIFs
See recorded ones.
Demo of the happy path (case 5 below):
Screen_recording_20260413_145110.mp4
Demo of case 11:
Screen_recording_20260413_152344.mp4
Tests
There are several cases to consider, here is a summary:
Tested devices
Checklist