Initial import of LogDarioSeq baseline

Establishes version control for the personal Logseq DB fork before
starting the server-client architecture migration and domain features
described in docs/agent-guide and the approved implementation plan.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-25 15:32:15 +02:00
commit 40631362b3
2016 changed files with 543898 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
(ns logseq.db-sync.worker-test
(:require [cljs.test :refer [deftest is]]
[datascript.core :as d]
[logseq.db-sync.order :as sync-order]
[logseq.db.common.order :as db-order]
[logseq.db.frontend.schema :as db-schema]))
(defn- new-conn []
(d/create-conn db-schema/schema))
(deftest duplicate-order-fix-test
(let [conn (new-conn)
parent (random-uuid)
block-a (random-uuid)
block-b (random-uuid)
order-a (db-order/gen-key nil nil)
order-b (db-order/gen-key order-a nil)]
(d/transact! conn [{:block/uuid parent}
{:block/uuid block-a
:block/parent [:block/uuid parent]
:block/order order-a}
{:block/uuid block-b
:block/parent [:block/uuid parent]
:block/order order-b}])
(let [tx [[:db/add [:block/uuid block-b] :block/order order-a]]
_ (sync-order/fix-duplicate-orders! conn tx {})
order-a' (:block/order (d/entity @conn [:block/uuid block-a]))
order-b' (:block/order (d/entity @conn [:block/uuid block-b]))]
(is (= order-a order-a'))
(is (not= order-a' order-b')))))