Fork me on GitHub
#chlorine
<
2020-03-23
>
jlmr08:03:51

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?

mauricio.szabo12:03:05

Hello. With chlorine:evaluate-block, does it hangs too?

jlmr13:03:03

@mauricio.szabo Yes it also hangs in that case

jlmr13:03:55

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}

mauricio.szabo13:03:20

Is it a commercial/private project, or is a code you can share so I can debug it here?

jlmr13:03:53

The code I’m using is:

(ns dc.context
  (:require [datahike.api :as d]))

(def uri "datahike:")

(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"}])

mauricio.szabo13:03:21

Yes, I can reproduce here. Thanks, I'll see what's happening

jlmr13:03:44

Great, as always: thanks for the help!

jlmr13:03:52

Let me know if I can do something to help

seancorfield15:03:45

@jlmr Are you using Cognitect's REBL?

jlmr15:03:52

I am 🙂

seancorfield15:03:33

If not, there's no point in using the inspect commands.

mauricio.szabo15:03:24

@seancorfield I think its a bug on Chlorine, because "evaluate-*" commands also freeze

seancorfield15:03:38

Oh, I missed that part. Fair enough.

mauricio.szabo16:03:08

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 😞

jlmr17:03:54

Oh that doesn’t sound like it’s an easy fix

vlaaad17:03:58

Hmm, could be something with datoms acting both as vectors and maps

mauricio.szabo17:03:59

I think the problem is with UNREPL - it is the result REALLY strangely...

jlmr17:03:15

Has it something to do with the reader tags?

mauricio.szabo17:03:43

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.