2FA / OTP code does not update when app is in background #1848

Closed
opened 2025-11-26 22:59:41 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @sh4dowb on GitHub (Apr 15, 2024).

Steps To Reproduce

  1. Open Bitwarden, choose a login
  2. Go back to another app, such as web browser
  3. Wait about 30 seconds, so that OTP expires
  4. Go back to Bitwarden in the background

Expected Result

New OTP code should be displayed

Actual Result

Previous OTP code (when app was last put to background) is displayed

Screenshots or Videos

No response

Additional Context

After switching back to Bitwarden, if you wait until OTP expires (again), the refreshed OTP code is correct.
A possible fix could be, force refreshing the OTP when app is "waken up(?)", since it's a lightweight operation

Operating System

iOS

Operating System Version

17.4.1

Device

iPhone 14

Build Version

2024.3.3 (7191)

Beta

  • Using a pre-release version of the application.
Originally created by @sh4dowb on GitHub (Apr 15, 2024). ### Steps To Reproduce 1. Open Bitwarden, choose a login 2. Go back to another app, such as web browser 3. Wait about 30 seconds, so that OTP expires 4. Go back to Bitwarden in the background ### Expected Result New OTP code should be displayed ### Actual Result Previous OTP code (when app was last put to background) is displayed ### Screenshots or Videos _No response_ ### Additional Context After switching back to Bitwarden, if you wait until OTP expires (again), the refreshed OTP code is correct. A possible fix could be, force refreshing the OTP when app is "waken up(?)", since it's a lightweight operation ### Operating System iOS ### Operating System Version 17.4.1 ### Device iPhone 14 ### Build Version 2024.3.3 (7191) ### Beta - [ ] Using a pre-release version of the application.
GiteaMirror added the bug label 2025-11-26 22:59:41 -06:00
Author
Owner

@NovaSilentium commented on GitHub (Apr 15, 2024):

Hi there,

I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below.

Thanks!

@NovaSilentium commented on GitHub (Apr 15, 2024): Hi there, I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below. Thanks!
Author
Owner

@sh4dowb commented on GitHub (Apr 15, 2024):

Hi there,

I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below.

Thanks!

https://github.com/bitwarden/mobile/assets/12783710/14dcbe9c-52f8-47ed-ba1e-5746adc4f8eb

Here is a screen recording of the problem

@sh4dowb commented on GitHub (Apr 15, 2024): > Hi there, > > I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below. > > Thanks! https://github.com/bitwarden/mobile/assets/12783710/14dcbe9c-52f8-47ed-ba1e-5746adc4f8eb Here is a screen recording of the problem
Author
Owner

@sh4dowb commented on GitHub (Apr 15, 2024):

In the source, I see that OnDisappearing() event calls _vm.StopCiphersTotpTick()
And LoadAsync() in CipherDetailsPageViewModel.cs calls TimerTask(..,StartCiphersTotpTick,..).RunPeriodic();
Not very experienced in Xamarin, but I think somewhere around LoadAsync() / timer creation or cancellation should be looked at, hope this helps!

@sh4dowb commented on GitHub (Apr 15, 2024): In the source, I see that `OnDisappearing()` event calls `_vm.StopCiphersTotpTick()` And `LoadAsync()` in `CipherDetailsPageViewModel.cs` calls `TimerTask(..,StartCiphersTotpTick,..).RunPeriodic();` Not very experienced in Xamarin, but I think somewhere around `LoadAsync()` / timer creation or cancellation should be looked at, hope this helps!
Author
Owner

@vvolkgang commented on GitHub (Jun 20, 2024):

Issue migrated to https://github.com/bitwarden/mobile/issues/3157

@vvolkgang commented on GitHub (Jun 20, 2024): Issue migrated to https://github.com/bitwarden/mobile/issues/3157
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#1848