Skip to content

[POC] Signin with Element Classic#6013

Merged
bmarty merged 2 commits intodevelopfrom
feature/bma/importSession
Jan 15, 2026
Merged

[POC] Signin with Element Classic#6013
bmarty merged 2 commits intodevelopfrom
feature/bma/importSession

Conversation

@bmarty
Copy link
Member

@bmarty bmarty commented Jan 15, 2026

Content

In order to let the user be able to migrate from Element Classic to Element X, we want Element X to propose the user to sign in using the existing session in Element Classic.

This PR does not contain the whole flow, but is introducing a way to let both application communicate together. We want to ensure that production application downloaded from the PlayStore are able to communicate together.

The UI is a temporary implementation, that's why no new strings have been added to Localazy yet.

Motivation and context

Part of element-hq/element-meta#3073

Screenshots / GIFs

Tests

  • Sign in to a session to be able to enable the new feature flag "Sign in with Element Classic"
  • Add a new account
  • No new button should be displayed, except if a version of Element Classic having the expecting service and having a session is installed on the device. PR on Element Classic to be able to test the whole flow: Expose service to let Element X access some internal data element-android#9109

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner January 15, 2026 11:08
@bmarty bmarty added the PR-Wip For anything that isn't ready to ship and will be enabled at a later date label Jan 15, 2026
@bmarty bmarty requested review from jmartinesp and removed request for a team January 15, 2026 11:08
@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/HzNGWD

Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Following the flow is a bit difficult, but that's just how the Messenger pattern works.

}
}

private val elementClassicConnectionStateFlow = MutableStateFlow<ElementClassicConnectionState>(ElementClassicConnectionState.Idle)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: just stateFlow is good enough? This is a bit verbose 😅 . Up to you, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sonarqubecloud
Copy link

* Handler of incoming messages from service.
*/
@Suppress("DEPRECATION")
inner class IncomingHandler : Handler() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ This Handler class should be static or leaks might occur (io.element.android.features.login.impl.screens.onboarding.classic.DefaultElementClassicConnection.IncomingHandler)

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 43.47826% with 104 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.28%. Comparing base (0dfdafd) to head (f645922).
⚠️ Report is 7 commits behind head on develop.

Files with missing lines Patch % Lines
...ens/onboarding/classic/ElementClassicConnection.kt 2.29% 85 Missing ⚠️
...es/login/impl/screens/onboarding/OnBoardingView.kt 33.33% 16 Missing and 2 partials ⚠️
.../android/libraries/featureflag/api/FeatureFlags.kt 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6013      +/-   ##
===========================================
- Coverage    81.38%   81.28%   -0.11%     
===========================================
  Files         2550     2556       +6     
  Lines        68272    68456     +184     
  Branches      8759     8783      +24     
===========================================
+ Hits         55564    55644      +80     
- Misses        9455     9557     +102     
- Partials      3253     3255       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bmarty bmarty merged commit d900054 into develop Jan 15, 2026
29 of 32 checks passed
@bmarty bmarty deleted the feature/bma/importSession branch January 15, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Wip For anything that isn't ready to ship and will be enabled at a later date

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants