                :mailserver/request-messages {:web3 (:web3 db)
                                              :mailserver    mailserver
                                              :request request-with-cursor}}))
-          (let [{:keys [chat-id] :as current-request} (db :mailserver/current-request)
-                gaps                    (db :mailserver/fetching-gaps-in-progress)
-                fetching-gap-completed? (= (get gaps chat-id)
-                                           (select-keys
-                                            current-request
-                                            [:from :to :force-to? :topics :chat-id]))]
-            (fx/merge cofx
-                      {:db            (-> db
-                                          (dissoc :mailserver/current-request)
-                                          (update :mailserver/requests-from
-                                                  #(apply dissoc % topics))
-                                          (update :mailserver/requests-to
-                                                  #(apply dissoc % topics))
-                                          (update :mailserver/topics merge mailserver-topics)
-                                          (update :mailserver/fetching-gaps-in-progress
-                                                  (fn [gaps]
-                                                    (if fetching-gap-completed?
-                                                      (dissoc gaps chat-id)
-                                                      gaps))))
-                       :data-store/tx (mapv (fn [[topic mailserver-topic]]
-                                              (data-store.mailservers/save-mailserver-topic-tx
-                                               {:topic            topic
-                                                :mailserver-topic mailserver-topic}))
-                                            mailserver-topics)}
-                      (process-next-messages-request))))))))
+          (fx/merge cofx
+                    {:db            (-> db
+                                        (dissoc :mailserver/current-request)
+                                        (update :mailserver/requests-from
+                                                #(apply dissoc % topics))
+                                        (update :mailserver/requests-to
+                                                #(apply dissoc % topics))
+                                        (update :mailserver/topics merge mailserver-topics)
+                                        (update :mailserver/fetching-gaps-in-progress
+                                                (fn [gaps]
+                                                  (if (executing-gap-request? db)
+                                                    (dissoc gaps (:chat-id request))
+                                                    gaps))))
+                     :data-store/tx (mapv (fn [[topic mailserver-topic]]
+                                            (data-store.mailservers/save-mailserver-topic-tx
+                                             {:topic            topic
+                                              :mailserver-topic mailserver-topic}))
+                                          mailserver-topics)}
+                    (process-next-messages-request)))))))
 
 (fx/defn retry-next-messages-request
   [{:keys [db] :as cofx}]

   A connection-check is made after `connection timeout` is reached and
   mailserver-state is changed to error if it is not connected by then"
  [{:keys [db] :as cofx}]
  (let [{:keys [address] :as mailserver} (fetch-current cofx)
        {:keys [peers-summary]} db
        added? (registered-peer? peers-summary
                                 address)]
    (fx/merge cofx
              {:db (dissoc db :mailserver/current-request)}
              (if added?
                (mark-trusted-peer)
                (add-peer)))))


(fx/defn resend-request
  [{:keys [db] :as cofx} {:keys [request-id]}]
  (let [current-request (:mailserver/current-request db)
        gap-request? (executing-gap-request? db)]
    ;; no inflight request, do nothing
    (when (and current-request
               ;; the request was never successful
