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

Nit: Cleanup "BackendFailures" in controller.cpp #10013

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

strseb
Copy link
Collaborator

@strseb strseb commented Nov 4, 2024

Time for some cleanup.

Description

This was the old hearbeat check

void MozillaVPN::heartbeatCompleted(bool success) {
  logger.debug() << "Server-side check done:" << success;

  if (!success) {
    m_private->m_controller.backendFailure();
    return;
  }

  if (m_state != StateBackendFailure) {
    return;
  }

  if (!modelsInitialized() || m_userState != UserAuthenticated) {
    setState(StateInitialize);
    return;
  }

  maybeStateMain();
}

So there we actually needed the controller to deativate and come back later.
Nowadays we only care during auth for heartbeat, we so vpn can't be activated anymore. So let's remove the controller code and rename all the screens to heartbeat failure, as otherwise a confused engineer might think this could have something to do with the daemon :)

@@ -1880,14 +1875,6 @@ void MozillaVPN::registerInspectorCommands() {
AddonManager::instance()->fetch();
return QJsonObject();
});

InspectorHandler::registerCommand(
"force_backend_failure", "Force a backend failure", 0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is actually a force_heartbeat_command aswell, so both did the same things 🫠

Copy link
Collaborator

@mcleinman mcleinman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

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.

2 participants