Skip to content
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

VPN-6710: fix Android time #10242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

VPN-6710: fix Android time #10242

wants to merge 1 commit into from

Conversation

mcleinman
Copy link
Collaborator

@mcleinman mcleinman commented Jan 31, 2025

Description

This PR fixes the timer when relaunching the Android app after a silent server switch or a server location switch initiated by the user. (In both cases, we want the timer to continue counting up and not reset to zero. While this was working as expected while the app remained open, when the app was quit and re-launched the timer would change.)

There were two parts to this fix:
First - In VPNService.kt, do not reset the timer when it is a server switch.

However, that didn't fix the bug. I ended up rabbit holing on this for quite a while. Eventually in the logs I noticed additional controller state changes when doing a server switch on Android that didn't exist in similar server switches on iOS. And then I realized the bug is Android's version of #9733. While the bug on Android isn't as catastrophic as it was on iOS (which is probably why it hung around for a bit longer), it has the same root cause - an additional state change that was recently added was affecting mobile clients' abilities to determine if an activation was coming from a server switch or not - because we rely on using the current state in Controller::Reason stateToReason(Controller::State state) to determine if it's a server switch... but by the time we were getting there, we were in StateConnecting and not StateServerSwitching.

Reference

VPN-6710

Checklist

  • My code follows the style guidelines for this project
  • I have not added any packages that contain high risk or unknown licenses (GPL, LGPL, MPL, etc. consult with DevOps if in question)
  • I have performed a self review of my own code
  • I have commented my code PARTICULARLY in hard to understand areas
  • I have added thorough tests where needed

@mcleinman mcleinman requested a review from strseb January 31, 2025 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant