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

Fix for network validation issues on wireless (fixes Issue #4331) #5542

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/gui/creds/webflowcredentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <QLabel>

#include "accessmanager.h"
#include "accountmanager.h"
#include "account.h"
#include "configfile.h"
#include "theme.h"
Expand Down Expand Up @@ -227,6 +228,10 @@ bool WebFlowCredentials::stillValid(QNetworkReply *reply) {
if (reply->error() != QNetworkReply::NoError) {
qCWarning(lcWebFlowCredentials()) << reply->error();
qCWarning(lcWebFlowCredentials()) << reply->errorString();
const auto accounts = AccountManager::instance()->accounts();
for (auto account : accounts) {
account->freshConnectionAttempt();
}
Comment on lines +231 to +234
Copy link
Collaborator

Choose a reason for hiding this comment

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

should you not call this only if the error is related to network issues ?
for example, imagine the desktop client doing a get request that will return a 404 result code, you do nto want to execute freshConnectionAttempt() after a 404

an easy way to spot the issue is to have a client wihtout end-to-end encryption enabled but a server with the app installed and enabled

then if you open the settings dialog, we check if the server has a public end-to-end encryption key, gets a 404 and disconnects the session turning the tray icon to the disconnected state for some time before turning connected again

second thing is that most probably such a fix would be needed for all credentials classes not only when using the web flow v2 related code (i.e. this WebFlowCredentials class) but also other authentication methods

}
return (reply->error() != QNetworkReply::AuthenticationRequiredError);
}
Expand Down