diff --git a/src/main/frontend/fs/sync.cljs b/src/main/frontend/fs/sync.cljs index 47da380e57..a06f804ca6 100644 --- a/src/main/frontend/fs/sync.cljs +++ b/src/main/frontend/fs/sync.cljs @@ -2234,9 +2234,11 @@ [graph-uuid file-path-without-base-path base-path] {:pre [(string? file-path-without-base-path)]} (go - (let [remote-meta (first ( remote-txid (let [remote-graph-info-or-ex (> (diff-file-metadata-sets local-all-files-meta remote-all-files-meta) - (sort-by (sort-file-metadata-fn :recent-days-range recent-10-days-range) >)) + (filter-local-files-in-deletion-logs local-all-files-meta deletion-logs-or-exp) + recent-10-days-range ((juxt #(tc/to-long (t/minus % (t/days 10))) #(tc/to-long %)) (t/today)) + diff-local-files (->> (diff-file-metadata-sets local-all-files-meta remote-all-files-meta) + (sort-by (sort-file-metadata-fn :recent-days-range recent-10-days-range) >)) change-events - (sequence - (comp - ;; convert to FileChangeEvent - (map #(->FileChangeEvent "change" base-path (.get-normalized-path ^FileMetadata %) - {:size (:size %)} (:etag %))) - (remove ignored?)) - diff-local-files) + (sequence + (comp + ;; convert to FileChangeEvent + (map #(->FileChangeEvent "change" base-path (.get-normalized-path ^FileMetadata %) + {:size (:size %)} (:etag %))) + (remove ignored?)) + diff-local-files) distinct-change-events (distinct-file-change-events change-events) - _ (swap! *sync-state #(sync-state-reset-full-local->remote-files % distinct-change-events)) + _ (swap! *sync-state #(sync-state-reset-full-local->remote-files % distinct-change-events)) change-events-partitions (sequence ;; partition FileChangeEvents @@ -2482,7 +2494,7 @@ (count (flatten change-events-partitions)) "files need to sync and" (count delete-local-files) "local files need to delete") (put-sync-event! {:event :start - :data {:type :full-local->remote + :data {:type :full-local->remote :graph-uuid graph-uuid :full-sync? true :epoch (tc/to-epoch (t/now))}}) @@ -2492,14 +2504,14 @@ (let [relative-p (relative-path f)] (when-not (local-file-item {:remote->local-type :delete - :checksum nil - :path relative-p}] + :checksum nil + :path relative-p}] (swap! *sync-state sync-state--add-recent-remote->local-files [fake-recent-remote->local-file-item]) (local-files - [fake-recent-remote->local-file-item]))))) + (swap! *sync-state sync-state--remove-recent-remote->local-files + [fake-recent-remote->local-file-item]))))) (recur fs))) ;; 2. upload local files