-
Notifications
You must be signed in to change notification settings - Fork 896
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 can't be reconnected in the same session when internet/wifi is disabled #13867
Conversation
1249cd0
to
9255ae1
Compare
73df7e2
to
d57028f
Compare
@@ -1015,6 +1016,12 @@ void BraveVpnService::OnPrepareCredentialsPresentation( | |||
FetchRegionData(false); | |||
} | |||
|
|||
if (!IsNetworkAvailable()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why connect failed setting is needed here?
Do you want to set it If we have network failure during the loading purchased state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and do you think purchased state also should be changed to (failed?) when network failed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a call form the panel to get credentials. Since the credentials are stored in prefs it goes here and trying to connect which takes some time and user sees loading throbber for some time. Probably better idea to put it into GetBraveVPNConnectionAPI()->CheckConnection
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved it to LoadPurchasedState
as discussed in Slack
@@ -900,6 +901,12 @@ void BraveVpnService::LoadPurchasedState() { | |||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | |||
if (GetPurchasedStateSync() == PurchasedState::LOADING) | |||
return; | |||
if (!IsNetworkAvailable()) { | |||
VLOG(2) << __func__ << ": Network is not available, failed to connect"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: failed to check purchased state
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keeping connect as discussed in Slack
if (!IsNetworkAvailable()) { | ||
VLOG(2) << __func__ << ": Network is not available, failed to connect"; | ||
SetPurchasedState(PurchasedState::NOT_PURCHASED); | ||
UpdateAndNotifyConnectionStateChange(ConnectionState::CONNECT_FAILED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to notify this by monitoring network state instead of doing here. Is it possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we call this from typescript when open the panel and wait for long timeout
6961d2a
to
f56d423
Compare
…sconnected and reconnected
2f0f372
to
2c68cd2
Compare
Resolves brave/brave-browser#23081
There are 2 different issues:
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: