Bug 2054812 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

### Steps to reproduce
1. Clean the app, authenticate a user
2. Move system time by a week forward
3. Kill and restart the app
4. Quickly start vpn authorization (either through onboarding or through settings; the time window is ~4 seconds)
5. Authorize VPN

### Expected behavior
VPN turns on
### Actual behavior
VPN locks in "connecting" state until restart
### Device information

* Firefox version: Nightly/Beta
* Android device model: Pixel 7
* Android OS version: 16

### Any additional information?

Bug 2052599 has a video from QA that shows the race condition with onboarding, but I was able to replicate it through regular settings. Here is a log of me going through the STR, navigating to vpn settings screen and pressing "Get Started". You can see that `CheckAccount` and `Toggle` happen before the account is initialized.

> Cleaner race - without onboarding
> ---------------------------- PROCESS ENDED (22304) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS ENDED (22223) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS ENDED (21913) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS ENDED (22102) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS ENDED (21879) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS STARTED (22871) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS STARTED (22903) for package org.mozilla.fenix.debug ----------------------------
> 19:42:36.905  I  StandaloneCoroutine{Active}@4e3de0e, account state = mozilla.components.service.fxa.manager.AccountState$Unknown@f82002f
> 19:42:36.906  I  ___________________________________________________
> 19:42:36.906  I  iPProtectionReducer, action = AccountManagerStateChanged(status=WarmingUp)
> 19:42:36.906  I  iPProtectionReducer, before state = eligibilityStatus = Unknown, serviceStatus = Uninitialized, accountStatus = Uninitialized
> 19:42:36.906  I  iPProtectionReducer, after state = eligibilityStatus = Unknown, serviceStatus = Uninitialized, accountStatus = WarmingUp
> 19:42:36.906  I  ___________________________________________________
> 19:42:36.913  I  iPProtectionReducer, action = EligibilityChanged(eligibility=Eligible)
> 19:42:36.913  I  iPProtectionReducer, before state = eligibilityStatus = Unknown, serviceStatus = Uninitialized, accountStatus = WarmingUp
> 19:42:36.913  I  iPProtectionReducer, after state = eligibilityStatus = Eligible, serviceStatus = Uninitialized, accountStatus = WarmingUp
> 19:42:36.913  I  ___________________________________________________
> 19:42:37.839  I  iPProtectionReducer, action = EngineStateChanged(info=StateInfo(serviceState=Unauthenticated, proxyState=NOT_READY, remaining=-1, max=-1, resetTime=null, lastError=null))
> 19:42:37.839  I  iPProtectionReducer, before state = eligibilityStatus = Eligible, serviceStatus = Uninitialized, accountStatus = WarmingUp
> 19:42:37.839  I  iPProtectionReducer, after state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = WarmingUp
> 19:42:37.839  I  ___________________________________________________
> ---------------------------- PROCESS STARTED (23121) for package org.mozilla.fenix.debug ----------------------------
> 19:42:39.584  I  iPProtectionReducer, action = mozilla.components.feature.ipprotection.store.IPProtectionAction$CheckAccount@dbd9842
> 19:42:39.584  I  iPProtectionReducer, before state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = WarmingUp
> 19:42:39.584  I  iPProtectionReducer, after state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = WarmingUp
> 19:42:39.584  I  ___________________________________________________
> 19:42:40.240  I  iPProtectionReducer, action = mozilla.components.feature.ipprotection.store.IPProtectionAction$Toggle@d39930a
> 19:42:40.240  I  iPProtectionReducer, before state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = WarmingUp
> 19:42:41.449  I  iPProtectionReducer, action = AwaitingAuth(status=AwaitingAuthentication)
> 19:42:41.449  I  iPProtectionReducer, before state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = RequestingAuthentication
> 19:42:41.449  I  iPProtectionReducer, after state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = AwaitingAuthentication
> 19:42:41.449  I  ___________________________________________________
> 19:42:41.449  I  Sync Store, action = UpdateAccount(account=Account(uid=f41caf8809c541aeb70f158d702d891c, email=mavduevskiy+ip21@mozilla.com, avatar=Avatar(url=https://profile.accounts.firefox.com/v1/avatar/m, isDefault=false), displayName=null))
> 19:42:41.449  I  Sync Store, before: status = NotInitialized, accountState = mozilla.components.service.fxa.manager.AccountState$Unknown@f82002f
> 19:42:41.449  I  Sync Store, after: status = NotInitialized, accountState = mozilla.components.service.fxa.manager.AccountState$Unknown@f82002f
> 19:42:41.449  I  Sync Store___________________________________________________
> 19:42:41.454  I  Sync Store, action = UpdateAccountState(accountState=mozilla.components.service.fxa.manager.AccountState$Authenticated@70c530c)
> 19:42:41.454  I  Sync Store, before: status = NotInitialized, accountState = mozilla.components.service.fxa.manager.AccountState$Unknown@f82002f
> 19:42:41.454  I  Sync Store, after: status = NotInitialized, accountState = mozilla.components.service.fxa.manager.AccountState$Authenticated@70c530c
> 19:42:41.454  I  Sync Store___________________________________________________
> 19:42:41.455  I  StandaloneCoroutine{Active}@4e3de0e, account state = mozilla.components.service.fxa.manager.AccountState$Authenticated@70c530c
> 19:42:41.455  I  ___________________________________________________
> 19:42:41.472  I  iPProtectionReducer, action = AccountManagerStateChanged(status=NeedsAuthorization)
> 19:42:41.472  I  iPProtectionReducer, before state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = AwaitingAuthentication
> 19:42:41.472  I  iPProtectionReducer, after state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = NeedsAuthorization
### Steps to reproduce
1. Clean the app, sign in a user (with sync, not vpn) 
2. Move system time by a week forward
3. Kill and restart the app
4. Quickly start vpn authorization (either through onboarding or through settings; the time window is ~4 seconds)
5. Authorize VPN

### Expected behavior
VPN turns on
### Actual behavior
VPN locks in "connecting" state until restart
### Device information

* Firefox version: Nightly/Beta
* Android device model: Pixel 7
* Android OS version: 16

### Any additional information?

Bug 2052599 has a video from QA that shows the race condition with onboarding, but I was able to replicate it through regular settings. Here is a log of me going through the STR, navigating to vpn settings screen and pressing "Get Started". You can see that `CheckAccount` and `Toggle` happen before the account is initialized.

> Cleaner race - without onboarding
> ---------------------------- PROCESS ENDED (22304) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS ENDED (22223) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS ENDED (21913) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS ENDED (22102) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS ENDED (21879) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS STARTED (22871) for package org.mozilla.fenix.debug ----------------------------
> ---------------------------- PROCESS STARTED (22903) for package org.mozilla.fenix.debug ----------------------------
> 19:42:36.905  I  StandaloneCoroutine{Active}@4e3de0e, account state = mozilla.components.service.fxa.manager.AccountState$Unknown@f82002f
> 19:42:36.906  I  ___________________________________________________
> 19:42:36.906  I  iPProtectionReducer, action = AccountManagerStateChanged(status=WarmingUp)
> 19:42:36.906  I  iPProtectionReducer, before state = eligibilityStatus = Unknown, serviceStatus = Uninitialized, accountStatus = Uninitialized
> 19:42:36.906  I  iPProtectionReducer, after state = eligibilityStatus = Unknown, serviceStatus = Uninitialized, accountStatus = WarmingUp
> 19:42:36.906  I  ___________________________________________________
> 19:42:36.913  I  iPProtectionReducer, action = EligibilityChanged(eligibility=Eligible)
> 19:42:36.913  I  iPProtectionReducer, before state = eligibilityStatus = Unknown, serviceStatus = Uninitialized, accountStatus = WarmingUp
> 19:42:36.913  I  iPProtectionReducer, after state = eligibilityStatus = Eligible, serviceStatus = Uninitialized, accountStatus = WarmingUp
> 19:42:36.913  I  ___________________________________________________
> 19:42:37.839  I  iPProtectionReducer, action = EngineStateChanged(info=StateInfo(serviceState=Unauthenticated, proxyState=NOT_READY, remaining=-1, max=-1, resetTime=null, lastError=null))
> 19:42:37.839  I  iPProtectionReducer, before state = eligibilityStatus = Eligible, serviceStatus = Uninitialized, accountStatus = WarmingUp
> 19:42:37.839  I  iPProtectionReducer, after state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = WarmingUp
> 19:42:37.839  I  ___________________________________________________
> ---------------------------- PROCESS STARTED (23121) for package org.mozilla.fenix.debug ----------------------------
> 19:42:39.584  I  iPProtectionReducer, action = mozilla.components.feature.ipprotection.store.IPProtectionAction$CheckAccount@dbd9842
> 19:42:39.584  I  iPProtectionReducer, before state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = WarmingUp
> 19:42:39.584  I  iPProtectionReducer, after state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = WarmingUp
> 19:42:39.584  I  ___________________________________________________
> 19:42:40.240  I  iPProtectionReducer, action = mozilla.components.feature.ipprotection.store.IPProtectionAction$Toggle@d39930a
> 19:42:40.240  I  iPProtectionReducer, before state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = WarmingUp
> 19:42:41.449  I  iPProtectionReducer, action = AwaitingAuth(status=AwaitingAuthentication)
> 19:42:41.449  I  iPProtectionReducer, before state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = RequestingAuthentication
> 19:42:41.449  I  iPProtectionReducer, after state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = AwaitingAuthentication
> 19:42:41.449  I  ___________________________________________________
> 19:42:41.449  I  Sync Store, action = UpdateAccount(account=Account(uid=f41caf8809c541aeb70f158d702d891c, email=mavduevskiy+ip21@mozilla.com, avatar=Avatar(url=https://profile.accounts.firefox.com/v1/avatar/m, isDefault=false), displayName=null))
> 19:42:41.449  I  Sync Store, before: status = NotInitialized, accountState = mozilla.components.service.fxa.manager.AccountState$Unknown@f82002f
> 19:42:41.449  I  Sync Store, after: status = NotInitialized, accountState = mozilla.components.service.fxa.manager.AccountState$Unknown@f82002f
> 19:42:41.449  I  Sync Store___________________________________________________
> 19:42:41.454  I  Sync Store, action = UpdateAccountState(accountState=mozilla.components.service.fxa.manager.AccountState$Authenticated@70c530c)
> 19:42:41.454  I  Sync Store, before: status = NotInitialized, accountState = mozilla.components.service.fxa.manager.AccountState$Unknown@f82002f
> 19:42:41.454  I  Sync Store, after: status = NotInitialized, accountState = mozilla.components.service.fxa.manager.AccountState$Authenticated@70c530c
> 19:42:41.454  I  Sync Store___________________________________________________
> 19:42:41.455  I  StandaloneCoroutine{Active}@4e3de0e, account state = mozilla.components.service.fxa.manager.AccountState$Authenticated@70c530c
> 19:42:41.455  I  ___________________________________________________
> 19:42:41.472  I  iPProtectionReducer, action = AccountManagerStateChanged(status=NeedsAuthorization)
> 19:42:41.472  I  iPProtectionReducer, before state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = AwaitingAuthentication
> 19:42:41.472  I  iPProtectionReducer, after state = eligibilityStatus = Eligible, serviceStatus = Unauthenticated, accountStatus = NeedsAuthorization

Back to Bug 2054812 Comment 0