From fdc73bed6040919ad9b65cf8dce73b35de0054b9 Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 1 Jul 2021 17:37:47 +0200 Subject: [PATCH] Query only one event at the beginning (to find the ID of the latest event) Syncthing's official web UI also does the first query for events like this. This should make loading times a bit faster and removes the possibility of picking-up obsolete events (which was always problematic). --- connector/syncthingconnection_requests.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/connector/syncthingconnection_requests.cpp b/connector/syncthingconnection_requests.cpp index 50601f7..76ad0de 100644 --- a/connector/syncthingconnection_requests.cpp +++ b/connector/syncthingconnection_requests.cpp @@ -1507,6 +1507,8 @@ void SyncthingConnection::requestEvents() QUrlQuery query; if (m_lastEventId) { query.addQueryItem(QStringLiteral("since"), QString::number(m_lastEventId)); + } else { + query.addQueryItem(QStringLiteral("limit"), QStringLiteral("1")); } // force to return immediately after the first call if (!m_hasEvents) {