Skip to content

Commit

Permalink
Notify even if pre-fetch etag header is empty
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
claucambra committed Aug 6, 2024
1 parent 16f0c5b commit 9941315
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/tray/notificationhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Check warning on line 87 in src/gui/tray/notificationhandler.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/tray/notificationhandler.cpp:87:14 [modernize-use-trailing-return-type]

use a trailing return type for this function
Expand Down

0 comments on commit 9941315

Please sign in to comment.