From 0a8e6dbbfb3b8d65ac5abc0ec55269a08c16f9b5 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 5 May 2022 12:43:23 +0100 Subject: [PATCH] Tweak that again --- syncapi/sync/requestpool.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syncapi/sync/requestpool.go b/syncapi/sync/requestpool.go index 34ae00fb8..101476574 100644 --- a/syncapi/sync/requestpool.go +++ b/syncapi/sync/requestpool.go @@ -265,6 +265,9 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi. syncReq.Log.WithField("currentPos", currentPos).Debugln("Responding to sync immediately") } + defer rp.updateLastSeen(req, device) + rp.updatePresence(req.Context(), rp.db, req.FormValue("set_presence"), device.UserID) + if syncReq.Since.IsEmpty() { // Complete sync syncReq.Response.NextBatch = types.StreamingToken{ @@ -338,9 +341,6 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi. } } - rp.updateLastSeen(req, device) - rp.updatePresence(req.Context(), rp.db, req.FormValue("set_presence"), device.UserID) - return util.JSONResponse{ Code: http.StatusOK, JSON: syncReq.Response,