[PR #2097] [MERGED] [SG-671] OTP Menu Screen causes Crash on Android #3348

Closed
opened 2025-11-26 23:31:32 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2097
Author: @andrebispo5
Created: 9/23/2022
Status: Merged
Merged: 9/26/2022
Merged by: @andrebispo5

Base: masterHead: bug/SG-671-totpscreen-crash


📝 Commits (10+)

  • 7c78c10 [SG-671] removed unnecessary calc of otpauth period. protected cal of otpauth from crashing the app if url has a wrong format.
  • 883c14a [SG-671] changed logger
  • a34719c [SG-671] Refactored GetQueryParams code to used HttpUtility.ParseQueryString.
  • 4e8252f [SG-671] refactor and null protection.
  • be54806 [SG-671] code format
  • ef3c63c [SG-671] fixed bug where totp circle countdown was fixed to 30.
  • ee25151 Merge branch 'master' into bug/SG-671-totpscreen-crash
  • 705d9d7 [SG-167] added fallback for uri check. Changed all default totp timers to constant.
  • 14744a5 Merge branch 'bug/SG-671-totpscreen-crash' of https://github.com/bitwarden/mobile into bug/SG-671-totpscreen-crash
  • 5c95158 [SG-671] missed unsaved file

📊 Changes

6 files changed (+25 additions, -29 deletions)

View changed files

📝 src/App/Pages/Vault/CipherDetailsPageViewModel.cs (+4 -4)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPageTOTPListItem.cs (+0 -2)
📝 src/App/Utilities/TotpHelper.cs (+6 -5)
📝 src/Core/Constants.cs (+1 -0)
📝 src/Core/Services/TotpService.cs (+2 -2)
📝 src/Core/Utilities/CoreHelpers.cs (+12 -16)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

User was not able to enter the ´Verification codes´ screen because the app was crashing. The crash was due to otpauth url having a bad format making the function to calculate the period throw an exception.

Code changes

Added protection against exception on the calc of the period, defaulting it to 30 seconds rotation.
src/App/Pages/Vault/GroupingsPage/GroupingsPageTOTPListItem.cs: removed calculation and variable that wasn't being used.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/2097 **Author:** [@andrebispo5](https://github.com/andrebispo5) **Created:** 9/23/2022 **Status:** ✅ Merged **Merged:** 9/26/2022 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `master` ← **Head:** `bug/SG-671-totpscreen-crash` --- ### 📝 Commits (10+) - [`7c78c10`](https://github.com/bitwarden/android/commit/7c78c10146d71feec11db79092e45b7345a49b4b) [SG-671] removed unnecessary calc of otpauth period. protected cal of otpauth from crashing the app if url has a wrong format. - [`883c14a`](https://github.com/bitwarden/android/commit/883c14a4009fb70e56ef443fb77295a7f48887b7) [SG-671] changed logger - [`a34719c`](https://github.com/bitwarden/android/commit/a34719ced12680eb0443732685a4993ec582cea5) [SG-671] Refactored GetQueryParams code to used HttpUtility.ParseQueryString. - [`4e8252f`](https://github.com/bitwarden/android/commit/4e8252fb88b39dbad768080d4895eec49e163956) [SG-671] refactor and null protection. - [`be54806`](https://github.com/bitwarden/android/commit/be54806374c4f4e94d81f39c4e48f64e725a4412) [SG-671] code format - [`ef3c63c`](https://github.com/bitwarden/android/commit/ef3c63cfe3cd1bc3b62468d1d00b426e8d4ba7d1) [SG-671] fixed bug where totp circle countdown was fixed to 30. - [`ee25151`](https://github.com/bitwarden/android/commit/ee25151dfde52be34b367cd748982fc5078c1048) Merge branch 'master' into bug/SG-671-totpscreen-crash - [`705d9d7`](https://github.com/bitwarden/android/commit/705d9d7bfc5fb719dd1ea3d92f6e0f082f81ebd9) [SG-167] added fallback for uri check. Changed all default totp timers to constant. - [`14744a5`](https://github.com/bitwarden/android/commit/14744a556c0cde071ded47045458b28fbfcf66ab) Merge branch 'bug/SG-671-totpscreen-crash' of https://github.com/bitwarden/mobile into bug/SG-671-totpscreen-crash - [`5c95158`](https://github.com/bitwarden/android/commit/5c95158e4547f3f7c849659c41924122f7e3733e) [SG-671] missed unsaved file ### 📊 Changes **6 files changed** (+25 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Pages/Vault/CipherDetailsPageViewModel.cs` (+4 -4) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPageTOTPListItem.cs` (+0 -2) 📝 `src/App/Utilities/TotpHelper.cs` (+6 -5) 📝 `src/Core/Constants.cs` (+1 -0) 📝 `src/Core/Services/TotpService.cs` (+2 -2) 📝 `src/Core/Utilities/CoreHelpers.cs` (+12 -16) </details> ### 📄 Description ## Type of change - [X] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> User was not able to enter the ´Verification codes´ screen because the app was crashing. The crash was due to otpauth url having a bad format making the function to calculate the period throw an exception. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> Added protection against exception on the calc of the period, defaulting it to 30 seconds rotation. **src/App/Pages/Vault/GroupingsPage/GroupingsPageTOTPListItem.cs:** removed calculation and variable that wasn't being used. ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:31:32 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3348