Hi, I’m experiencing something strange with chlorine. I’m trying out https://github.com/replikativ/datahike/ and chlorine “hangs” when I try to eval/inspect (using @seancorfield’s sean:inspect-block
command) a (d/transact tx-data)
form. The same form returns almost immedeatly if I paste it directly into the repl in my terminal.
How can I debug this issue?
Hello. With chlorine:evaluate-block
, does it hangs too?
@mauricio.szabo Yes it also hangs in that case
In the terminal repl the same form returns the following:
#datahike.db.TxReport{:db-before #datahike/DB {:schema {:db/ident #:db{:unique :db.unique/identity}, :page/title #:db{:ident :page/title, :valueType :db.type/string, :cardinality :db.cardinality/one, :unique :db.unique/identity}, 1 :page/title}}, :db-after #datahike/DB {:schema {:db/ident #:db{:unique :db.unique/identity}, :page/title #:db{:ident :page/title, :valueType :db.type/string, :cardinality :db.cardinality/one, :unique :db.unique/identity}, 1 :page/title}}, :tx-data [#datahike/Datom [536870915 :db/txInstant #inst "2020-03-23T13:38:30.527-00:00" 536870915 true]], :tempids #:db{:current-tx 536870915}, :tx-meta nil}
Is it a commercial/private project, or is a code you can share so I can debug it here?
It’s a public project I’m using: https://github.com/replikativ/datahike/blob/master/src/datahike/api.cljc#L72
The code I’m using is:
(ns dc.context
(:require [datahike.api :as d]))
(def uri "datahike:<mem://dc>")
(def schema [{:db/ident :page/title
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db/unique :db.unique/identity}])
(d/create-database uri :initial-tx schema)
(def conn (d/connect uri))
(d/transact conn [{:page/title "Welcome"}
{:page/title "Hello World"}])
Yes, I can reproduce here. Thanks, I'll see what's happening
Great, as always: thanks for the help!
Let me know if I can do something to help
@jlmr Are you using Cognitect's REBL?
If not, there's no point in using the inspect
commands.
@seancorfield I think its a bug on Chlorine, because "evaluate-*" commands also freeze
Oh, I missed that part. Fair enough.
I am 🙂
Oh, that's strange... it's somehow parsing your result as a map with duplicated key: 1
... and the parser I'm using clojure.reader/read-string
😞
Oh that doesn’t sound like it’s an easy fix
Hmm, could be something with datoms acting both as vectors and maps
I think the problem is with UNREPL - it is the result REALLY strangely...
Has it something to do with the reader tags?
I don't think so. I just reported to UNREPL: https://github.com/Unrepl/unrepl/issues/52, but I'll also try to debug from here.