diff options
| author | saturneric <[email protected]> | 2026-09-24 22:47:57 +0200 |
|---|---|---|
| committer | saturneric <[email protected]> | 2026-09-24 22:47:57 +0200 |
| commit | 3f35eadd77b34a5ab13f89772583d153bbebdc70 (patch) | |
| tree | 14805ea3b65565e5902f77d3b954b33671d0e0b8 /src/m_key_server_sync/VKSInterface.cpp | |
| parent | feat(im): add instant messaging token module (diff) | |
| download | modules-3f35eadd77b34a5ab13f89772583d153bbebdc70.tar.gz modules-3f35eadd77b34a5ab13f89772583d153bbebdc70.zip | |
fix(key-server): handle missing keys consistently
- normalize 404 and empty responses as plain not-found results
- distinguish missing keys from transport failures in publication checks
- add key-server not-found helpers and unit coverage
- disable batch actions for key groups and empty targets
- add publish and refresh actions to the key manager menu
- reformat affected C++ declarations and callbacks
Diffstat (limited to 'src/m_key_server_sync/VKSInterface.cpp')
| -rw-r--r-- | src/m_key_server_sync/VKSInterface.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/m_key_server_sync/VKSInterface.cpp b/src/m_key_server_sync/VKSInterface.cpp index 006729c..5bceb6a 100644 --- a/src/m_key_server_sync/VKSInterface.cpp +++ b/src/m_key_server_sync/VKSInterface.cpp @@ -41,6 +41,7 @@ #include <QUrlQuery> #include "GFModule.h" +#include "KeyServerBatchLogic.h" namespace { /// Matches the HKP side; without it a stalled server hangs the caller forever. @@ -144,7 +145,12 @@ void VKSInterface::RequestVerify(const QString& token, void VKSInterface::on_reply_finished(QNetworkReply* reply) { if (reply->error() != QNetworkReply::NoError) { - emit SignalErrorOccurred(reply->errorString(), reply->readAll()); + // A 404 from a lookup is an answer, not a failure: the server has no + // such key. Said plainly, rather than as Qt's transfer error. + const auto error = reply->error() == QNetworkReply::ContentNotFoundError + ? KeyServerBatchLogic::NotFoundText() + : reply->errorString(); + emit SignalErrorOccurred(error, reply->readAll()); reply->deleteLater(); return; } |
