From 6f64053dd57899baa7be9ca21739634b30b59b8f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 30 Nov 2020 15:33:20 +0100 Subject: [PATCH] :sparkles: Discard wrong queued change if back fails. --- frontend/src/app/main/data/workspace/persistence.cljs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/data/workspace/persistence.cljs b/frontend/src/app/main/data/workspace/persistence.cljs index 098464d40..57ee632b1 100644 --- a/frontend/src/app/main/data/workspace/persistence.cljs +++ b/frontend/src/app/main/data/workspace/persistence.cljs @@ -125,9 +125,13 @@ (rx/map #(shapes-changes-persisted file-id %)))))) on-error - (fn [error] - (rx/of (update-persistence-status {:status :error - :reason (:type error)})))] + (fn [{:keys [type status] :as error}] + (if (and (= :server-error type) + (= 502 status)) + (rx/of (update-persistence-status {:status :error :reason type})) + (rx/of update-persistence-queue + (update-persistence-status {:status :error :reason type}))))] + (when (= file-id (:id file)) (->> (rp/mutation :update-file params)