Skip to content

Commit

Permalink
fix: nbb test
Browse files Browse the repository at this point in the history
  • Loading branch information
RCmerci committed Dec 28, 2024
1 parent 26e2fad commit f7815b4
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 27 deletions.
4 changes: 3 additions & 1 deletion .carve/ignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,6 @@ frontend.worker.rtc.hash/hash-blocks
;; Repl fn
frontend.rum/use-atom-in
;; missionary utils
frontend.common.missionary-util/<!
frontend.common.missionary/<!
;; only used in deps/common
frontend.common.missionary/background-task-running?
7 changes: 5 additions & 2 deletions deps/db/src/logseq/db/frontend/entity_plus.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
[datascript.core :as d]
[datascript.impl.entity :as entity :refer [Entity]]
[logseq.common.util.date-time :as date-time-util]
[logseq.common.missionary :as c.m]
[logseq.db.frontend.entity-util :as entity-util]
[logseq.db.frontend.property :as db-property]))

Expand Down Expand Up @@ -48,7 +47,11 @@
(vreset! *seen-immutable-entities {}))

(def ^:private *reset-cache-background-task-running?
(delay (c.m/background-task-running? :logseq.db.frontend.entity-plus/reset-immutable-entities-cache!)))
;; missionary is not compatible with nbb, so enitity-memoized is disabled in nbb
(delay
#?(:org.babashka/nbb false
:cljs ((resolve 'frontend.common.missionary/background-task-running?)
:logseq.db.frontend.entity-plus/reset-immutable-entities-cache!))))

(defn entity-memoized
[db eid]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/background_tasks.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns frontend.background-tasks
"Some background tasks"
(:require [frontend.flows :as flows]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.db.frontend.entity-plus :as entity-plus]
[missionary.core :as m]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns logseq.common.missionary
(ns frontend.common.missionary
"Macros for missionary"
(:require [missionary.core :as m]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns logseq.common.missionary
(ns frontend.common.missionary
"Utils based on missionary. Used by frontend and worker namespaces"
(:require-macros [logseq.common.missionary])
(:require-macros [frontend.common.missionary])
(:require [cljs.core.async.impl.channels]
[clojure.core.async :as a]
[missionary.core :as m]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/components/header.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[frontend.ui :as ui]
[frontend.util :as util]
[frontend.version :refer [version]]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.db :as ldb]
[logseq.shui.ui :as shui]
[logseq.shui.util :as shui-util]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/components/rtc/indicator.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[frontend.state :as state]
[frontend.ui :as ui]
[frontend.util :as util]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.shui.ui :as shui]
[missionary.core :as m]
[rum.core :as rum]))
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/db/rtc/debug_ui.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[frontend.state :as state]
[frontend.ui :as ui]
[frontend.util :as util]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.db :as ldb]
[logseq.shui.ui :as shui]
[missionary.core :as m]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/extensions/fsrs.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[frontend.state :as state]
[frontend.ui :as ui]
[frontend.util :as util]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.db :as ldb]
[logseq.db.frontend.entity-plus :as entity-plus]
[logseq.shui.ui :as shui]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/handler/assets.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[frontend.state :as state]
[frontend.util :as util]
[logseq.common.config :as common-config]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.common.path :as path]
[logseq.common.util :as common-util]
[medley.core :as medley]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/handler/db_based/rtc.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[frontend.handler.notification :as notification]
[frontend.handler.user :as user-handler]
[frontend.state :as state]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.common.util :as common-util]
[logseq.db :as ldb]
[logseq.db.sqlite.common-db :as sqlite-common-db]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/handler/db_based/rtc_flows.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns frontend.handler.db-based.rtc-flows
"Flows related to RTC"
(:require [frontend.state :as state]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.common.util :as common-util]
[missionary.core :as m]))

Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/handler/user.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[cljs-time.core :as t]
[cljs.core.async :as async :refer [<! go]]
[clojure.string :as string]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[frontend.config :as config]
[frontend.debug :as debug]
[frontend.handler.config :as config-handler]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/worker/device.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[frontend.worker.rtc.ws-util :as ws-util]
[frontend.worker.state :as worker-state]
[goog.crypt.base64 :as base64]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.db :as ldb]
[missionary.core :as m]
[promesa.core :as p]))
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/worker/rtc/asset.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[frontend.worker.rtc.log-and-state :as rtc-log-and-state]
[frontend.worker.rtc.ws-util :as ws-util]
[frontend.worker.state :as worker-state]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.common.path :as path]
[logseq.db :as ldb]
[malli.core :as ma]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/worker/rtc/client.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[frontend.worker.rtc.skeleton :as r.skeleton]
[frontend.worker.rtc.ws :as ws]
[frontend.worker.rtc.ws-util :as ws-util]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[missionary.core :as m]))

(defn- register-graph-updates
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/worker/rtc/client_op.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(:require [datascript.core :as d]
[frontend.worker.rtc.const :as rtc-const]
[frontend.worker.state :as worker-state]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.db.sqlite.util :as sqlite-util]
[malli.core :as ma]
[malli.transform :as mt]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/worker/rtc/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[frontend.worker.state :as worker-state]
[frontend.worker.util :as worker-util]
[logseq.common.config :as common-config]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.db :as ldb]
[malli.core :as ma]
[missionary.core :as m])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[frontend.worker.rtc.ws-util :as ws-util]
[frontend.worker.state :as worker-state]
[frontend.worker.util :as worker-util]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.db :as ldb]
[logseq.db.frontend.malli-schema :as db-malli-schema]
[logseq.db.frontend.schema :as db-schema]
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/worker/rtc/log_and_state.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Fns to generate rtc related logs"
(:require [frontend.common.schema-register :as sr]
[frontend.worker.util :as worker-util]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[malli.core :as ma]
[missionary.core :as m]))

Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/worker/rtc/ws.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(:require [cljs-http-missionary.client :as http]
[frontend.worker.rtc.const :as rtc-const]
[frontend.worker.rtc.exception :as r.ex]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[missionary.core :as m]))

(defn- get-state
Expand Down
2 changes: 1 addition & 1 deletion src/rtc_e2e_test/client_steps.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[frontend.worker.rtc.client-op :as client-op]
[frontend.worker.rtc.core :as rtc-core]
[helper]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.db :as ldb]
[missionary.core :as m]))

Expand Down
2 changes: 1 addition & 1 deletion src/rtc_e2e_test/fixture.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[frontend.worker.rtc.db-listener]
[frontend.worker.state :as worker-state]
[helper]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[missionary.core :as m]))

(def install-some-consts
Expand Down
2 changes: 1 addition & 1 deletion src/rtc_e2e_test/helper.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[frontend.worker.rtc.core :as rtc.core]
[frontend.worker.rtc.log-and-state :as rtc-log-and-state]
[frontend.worker.state :as worker-state]
[logseq.common.missionary :as c.m]
[frontend.common.missionary :as c.m]
[logseq.db :as ldb]
[logseq.db.frontend.order :as db-order]
[logseq.outliner.batch-tx :as batch-tx]
Expand Down
2 changes: 1 addition & 1 deletion src/test/frontend/db/db_based_model_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

(use-fixtures :each start-and-destroy-db)

(deftest ^:xxx get-all-classes-test
(deftest get-all-classes-test
(let [opts {:redirect? false :create-first-block? false :class? true}
_ (test-helper/create-page! "class1" opts)
_ (test-helper/create-page! "class2" opts)]
Expand Down

0 comments on commit f7815b4

Please sign in to comment.