Skip to content

fix: persist self email to register device with 2fa [WPB-16573] #3929

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

Merged
merged 5 commits into from
Mar 20, 2025

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Mar 20, 2025

BugWPB-16573 [Android] Invalid information alert received although login is valid


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

When registering device with 2fa, the code is saved from login so that it can be reused, but it uses email as the key.
Currently, the app doesn't know self user's email until initial sync is performed (only then fetchSelfUser is executed) so when trying to get email during device registration, it returns null and 2fa code cannot be retrieved resulting in error.

Solutions

Persist self user email (in User table but with flag informing that this user's data is incomplete) right after login and when the user session is created so that it can be used during client registration.

In this PR also LoginEmailViewModelTest got updated to use Arrangement.

Dependencies (Optional)

Needs releases with:

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Login with email on account that requires 2FA.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@codecov-commenter
Copy link

codecov-commenter commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.77%. Comparing base (a6254ef) to head (4a4e569).

Additional details and impacted files
@@                  Coverage Diff                  @@
##           release/candidate    #3929      +/-   ##
=====================================================
+ Coverage              45.74%   45.77%   +0.02%     
=====================================================
  Files                    492      492              
  Lines                  17097    17105       +8     
  Branches                2845     2847       +2     
=====================================================
+ Hits                    7821     7829       +8     
  Misses                  8483     8483              
  Partials                 793      793              
Files with missing lines Coverage Δ
.../authentication/login/email/LoginEmailViewModel.kt 77.46% <100.00%> (+1.34%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a6254ef...4a4e569. Read the comment docs.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@saleniuk saleniuk requested review from a team, sbakhtiarov, yamilmedina, MohamadJaara, vitorhugods and emmaoke-w and removed request for a team March 20, 2025 11:21
@saleniuk saleniuk removed the request for review from emmaoke-w March 20, 2025 11:26
Copy link

Copy link
Contributor

Built wire-android-staging-compat-pr-3929.apk is available for download

@saleniuk saleniuk added this pull request to the merge queue Mar 20, 2025
Merged via the queue into release/candidate with commit a57eadc Mar 20, 2025
13 of 14 checks passed
@saleniuk saleniuk deleted the fix/login-with-email-and-2fa branch March 20, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants