Sfoglia il codice sorgente

fix(sync): trigger remote->local-full-sync when no diff txn founded

rcmerci 3 anni fa
parent
commit
bebf224f42
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/main/frontend/fs/sync.cljs

+ 2 - 2
src/main/frontend/fs/sync.cljs

@@ -773,7 +773,8 @@
               (if (instance? ExceptionInfo diff-r)
               (if (instance? ExceptionInfo diff-r)
                 diff-r
                 diff-r
                 (let [[diff-txns latest-txid min-txid] diff-r]
                 (let [[diff-txns latest-txid min-txid] diff-r]
-                  (if (> (dec min-txid) @*txid) ;; if min-txid-1 > @*txid, need to remote->local-full-sync
+                  (if (or (nil? min-txid)             ;; if min-txid is nil(not found any diff txn)
+                          (> (dec min-txid) @*txid))  ;; or min-txid-1 > @*txid, need to remote->local-full-sync
                     (do (println "min-txid" min-txid "request-txid" @*txid)
                     (do (println "min-txid" min-txid "request-txid" @*txid)
                         {:need-remote->local-full-sync true})
                         {:need-remote->local-full-sync true})
 
 
@@ -854,7 +855,6 @@
 
 
          ("add" "change")
          ("add" "change")
          (let [path (relative-path e)]
          (let [path (relative-path e)]
-           (println "debug " path basepath)
            (when (and (<! (local-file-exists? path basepath))
            (when (and (<! (local-file-exists? path basepath))
                       (<! (file-changed? graph-uuid path basepath)))
                       (<! (file-changed? graph-uuid path basepath)))
              (>! result e))))
              (>! result e))))