Fork me on GitHub
#datalevin
<
2022-10-03
>
flowthing19:10:34

Why does the second d/transact! fail (and the third doesn’t)?

Huahai19:10:34

What’s the failure?

Huahai19:10:57

Looks to me a full text index problem

flowthing20:10:12

ExceptionInfo Document does not exist. {:doc-ref #datalevin/Datom [1 :link/description ""]}
	datalevin.search.SearchEngine (search.clj:347)
	datalevin.storage.Store (storage.cljc:355)
	datalevin.db/local-transact-tx-data (db.cljc:1007)
	datalevin.db/local-transact-tx-data (db.cljc:781)
	datalevin.db/transact-tx-data (db.cljc:1041)
	datalevin.db/transact-tx-data (db.cljc:1021)
	datalevin.core/with (core.cljc:282)
	datalevin.core/with (core.cljc:276)
	datalevin.core/with (core.cljc:279)
	datalevin.core/with (core.cljc:276)
	datalevin.core/-transact!/fn--18754/fn--18755 (core.cljc:533)
	clojure.lang.Atom.swap (Atom.java:37)

flowthing20:10:35

Indeed — but am I doing something wrong, or is it a bug in Datalevin?

Huahai20:10:00

it’s probably another corner case, empty doc

Huahai20:10:02

i will fix it, but as a general suggestion, there’s no need to store empty string in a Datalog store

flowthing20:10:07

Thanks! I believe it is also possible to reproduce this issue with a non-empty string, but I’ll need to double-check.

Huahai20:10:50

please file an issue if you can, thanks

flowthing20:10:47

Certainly. Will do if I can come up with a repro. Thanks!

🙏 1
flowthing21:10:31

All right, I think I nailed it down… the error can occur if you’ve stored an empty string in Datalevin previously, even if you’ve changed it to a non-empty string since. I changed my code to avoid inserting an empty string into a fulltext attribute (and wiped the database) and everything seems to work fine now. I can file an issue about the empty string error tomorrow.

flowthing18:11:36

Yep, noticed, thanks!