From: Claudio Cambra Date: Tue, 6 Aug 2024 08:52:39 +0000 (+0800) Subject: Notify even if pre-fetch etag header is empty X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~6^2~21^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4417d98c26ff24e39703d231b0935081c39a6c33;p=nextcloud-desktop.git Notify even if pre-fetch etag header is empty This prevents situations where the server does not provide an etag header. This would make the empty pre-fetch and empty post-fetch etag headers match, meaning notifications would never be notified Signed-off-by: Claudio Cambra --- diff --git a/src/gui/tray/notificationhandler.cpp b/src/gui/tray/notificationhandler.cpp index 46e876b66..b2a9fc78b 100644 --- a/src/gui/tray/notificationhandler.cpp +++ b/src/gui/tray/notificationhandler.cpp @@ -81,7 +81,7 @@ void ServerNotificationHandler::slotNotificationsReceived(const QJsonDocument &j // In theory the server should five us a 304 Not Modified if there are no new notifications. // But in practice, the server doesn't always do that. So we need to compare the ETag headers. const auto postFetchEtagHeader = _accountState->notificationsEtagResponseHeader(); - if (_preFetchEtagHeader == postFetchEtagHeader) { + if (!_preFetchEtagHeader.isEmpty() || _preFetchEtagHeader == postFetchEtagHeader) { qCInfo(lcServerNotification) << "Notifications ETag header is the same as before, no new notifications."; deleteLater(); emit jobFinished();