mirror of
https://github.com/logseq/logseq.git
synced 2026-05-16 17:02:34 +00:00
fix: fix order should be after rebase ops
This commit is contained in:
@@ -305,7 +305,6 @@
|
||||
[conn {:keys [tx outliner-op]}]
|
||||
(let [tx-data (->> (protocol/transit->tx tx)
|
||||
(sanitize-tx @conn outliner-op))]
|
||||
(prn :debug :entity (:block/parent (d/entity @conn [:block/uuid #uuid "69d38949-1f23-4e1c-b7d9-861c16cfdb2c"])))
|
||||
(when (seq tx-data)
|
||||
(ldb/transact! conn tx-data (cond-> {:op :apply-client-tx}
|
||||
outliner-op (assoc :outliner-op outliner-op))))))
|
||||
|
||||
1
deps/db/src/logseq/db.cljs
vendored
1
deps/db/src/logseq/db.cljs
vendored
@@ -254,7 +254,6 @@
|
||||
|
||||
(let [batch-tx-data @*tx-data
|
||||
_ (reset! *tx-data nil)
|
||||
_ (prn :debug :batch-tx-data batch-tx-data)
|
||||
tx-report {:db-before db-before
|
||||
:db-after @conn
|
||||
:tx-meta tx-meta
|
||||
|
||||
3
deps/outliner/src/logseq/outliner/core.cljs
vendored
3
deps/outliner/src/logseq/outliner/core.cljs
vendored
@@ -460,7 +460,6 @@
|
||||
block' (if (de/entity? block)
|
||||
block
|
||||
(merge entity block))]
|
||||
(prn :debug :block block')
|
||||
(otree/-save block' *txs-state db opts)
|
||||
{:tx-data @*txs-state}))))
|
||||
|
||||
@@ -1093,8 +1092,8 @@
|
||||
(ldb/transact! (first args) (:tx-data result) tx-meta)))
|
||||
result)
|
||||
(catch :default e
|
||||
(js/console.error e)
|
||||
(when-not (= "not-allowed-move-block-page" (ex-message e))
|
||||
(js/console.error e)
|
||||
(throw e)))))
|
||||
|
||||
(let [f (fn [conn block opts]
|
||||
|
||||
@@ -527,10 +527,8 @@
|
||||
|
||||
(defn reverse-local-txs!
|
||||
[conn local-txs]
|
||||
(prn :debug :local-txs local-txs)
|
||||
(doall
|
||||
(->> local-txs
|
||||
(remove (fn [tx] (= :fix (:outliner-op tx))))
|
||||
reverse
|
||||
(map-indexed
|
||||
(fn [index local-tx]
|
||||
@@ -655,7 +653,6 @@
|
||||
db @conn]
|
||||
(when-not (and target-block (seq blocks))
|
||||
(invalid-rebase-op! op {:args args}))
|
||||
(prn :debug :insert-blocks :target-block target-block)
|
||||
(outliner-core/insert-blocks! conn
|
||||
(mapv #(op-construct/rewrite-block-title-with-retracted-refs db %) blocks)
|
||||
target-block
|
||||
@@ -866,7 +863,6 @@
|
||||
(fn [conn]
|
||||
(if (= [[:transact nil]] outliner-ops)
|
||||
(when-let [tx-data (seq (:tx local-tx))]
|
||||
(prn :debug :transact :tx-data tx-data)
|
||||
(ldb/transact! conn tx-data {:outliner-op :transact}))
|
||||
(do
|
||||
;; (precreate-missing-save-blocks! conn outliner-ops)
|
||||
@@ -911,10 +907,10 @@
|
||||
(when (and (= :rebase (:outliner-op tx-meta))
|
||||
(seq tx-data))
|
||||
(swap! *rebase-tx-reports conj tx-report)))})]
|
||||
(fix-tx! conn tx-report {:outliner-op :fix}))
|
||||
(doseq [tx-report @*rebase-tx-reports]
|
||||
(handle-local-tx! repo tx-report))
|
||||
|
||||
(doseq [tx-report @*rebase-tx-reports]
|
||||
(handle-local-tx! repo tx-report))
|
||||
(fix-tx! conn tx-report {:outliner-op :fix}))
|
||||
|
||||
(remove-pending-txs! repo (map :tx-id local-txs))
|
||||
|
||||
@@ -993,10 +989,10 @@
|
||||
[repo {:keys [tx-data db-after db-before tx-meta] :as tx-report}]
|
||||
(let [normalized (normalize-tx-data db-after db-before tx-data)
|
||||
reversed-datoms (reverse-tx-data db-before db-after tx-data)]
|
||||
(prn :debug :enqueue-local-tx :tx-data)
|
||||
(cljs.pprint/pprint tx-data)
|
||||
(prn :debug :enqueue-local-tx :normalized)
|
||||
(cljs.pprint/pprint normalized)
|
||||
;; (prn :debug :enqueue-local-tx :tx-data)
|
||||
;; (cljs.pprint/pprint tx-data)
|
||||
;; (prn :debug :enqueue-local-tx :normalized)
|
||||
;; (cljs.pprint/pprint normalized)
|
||||
(when (and (= (:outliner-op tx-meta) :insert-blocks)
|
||||
(not (:undo? tx-meta))
|
||||
(not (some (fn [x]
|
||||
|
||||
Reference in New Issue
Block a user