File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 341341 fix-page-tags-tx-data
342342 fix-inline-page-tx-data)))
343343
344+ (defn- remove-duplicated-datoms
345+ [datoms]
346+ (let [duplicated-datoms (->> datoms
347+ (group-by (fn [d] (take 4 d))) ; group by '(e a v tx)
348+ (keep (fn [[_eavt same-v-datoms]]
349+ (when (>= (count same-v-datoms) 2 )
350+ (butlast same-v-datoms))))
351+ (apply concat)
352+ set)]
353+ (remove duplicated-datoms datoms)))
354+
344355(defn transact-pipeline
345356 " Compute extra tx-data and block/refs, should ensure it's a pure function and
346357 doesn't call `d/transact!` or `ldb/transact!`."
373384 replace-tx-report (when (seq block-refs-tx-id-data)
374385 (d/with (:db-after tx-report*) block-refs-tx-id-data))
375386 tx-report' (or replace-tx-report tx-report*)
376- full-tx-data (concat (:tx-data tx-report*)
377- (:tx-data replace-tx-report))]
387+ full-tx-data (-> (concat (:tx-data tx-report*)
388+ (:tx-data replace-tx-report))
389+ remove-duplicated-datoms)]
378390 (assoc tx-report'
379391 :tx-data full-tx-data
380392 :tx-meta tx-meta
You can’t perform that action at this time.
0 commit comments