Skip to content

fix: handle 2fa on RegisterDeviceScreen [WPB-16573] #3934

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 28, 2025

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Mar 24, 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

RegisterDeviceScreen, which is kind of a fallback flow when the device hasn't been registered successfully during account creation or login, has been missing a logic of handling 2FA codes when registering a client so in that case user hasn't been able to register device properly resulting in not being able to use the app properly.

Solutions

Implemented handling 2FA code also on that screen, similarly to the way it's handled during the login - first the code that is persisted from the last login is used and if that returns Invalid2FA then new code is requested and the user needs to enter it to complete the registration flow.

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

It's hard to reproduce manually as it can happen for instance when login is completed but device registration request that's executed right after it fails because of a crash for instance.

Attachments (Optional)

register_client_with_2fa.mp4

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.

Copy link

Copy link

codecov bot commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 78.48101% with 17 lines in your changes missing coverage. Please review.

Project coverage is 45.95%. Comparing base (a57eadc) to head (7b4a454).
Report is 4 commits behind head on release/candidate.

Files with missing lines Patch % Lines
...cation/devices/register/RegisterDeviceViewModel.kt 76.27% 11 Missing and 3 partials ⚠️
...n/kotlin/com/wire/android/ui/home/HomeViewModel.kt 88.88% 0 Missing and 2 partials ⚠️
.../main/kotlin/com/wire/android/ui/home/HomeState.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           release/candidate    #3934      +/-   ##
=====================================================
+ Coverage              45.77%   45.95%   +0.18%     
=====================================================
  Files                    492      492              
  Lines                  17105    17150      +45     
  Branches                2847     2857      +10     
=====================================================
+ Hits                    7829     7882      +53     
+ Misses                  8483     8471      -12     
- Partials                 793      797       +4     
Files with missing lines Coverage Δ
.../main/kotlin/com/wire/android/ui/home/HomeState.kt 64.28% <50.00%> (+35.71%) ⬆️
...n/kotlin/com/wire/android/ui/home/HomeViewModel.kt 83.33% <88.88%> (+20.58%) ⬆️
...cation/devices/register/RegisterDeviceViewModel.kt 76.84% <76.27%> (+5.14%) ⬆️

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 a57eadc...7b4a454. Read the comment docs.

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

Copy link
Contributor

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

@saleniuk saleniuk requested review from a team, typfel, alexandreferris, Garzas, mathias-niboulies and emmaoke-w and removed request for a team March 25, 2025 08:36
@saleniuk saleniuk added this pull request to the merge queue Mar 28, 2025
Merged via the queue into release/candidate with commit b843e93 Mar 28, 2025
15 checks passed
@saleniuk saleniuk deleted the fix/handle-2fa-on-registerdevicescreen branch March 28, 2025 18:17
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.

3 participants