asami

Asami, the graph database https://github.com/threatgrid/asami
Andrea 2021-04-19T15:36:51.253700Z

👋 Asamers hello, I’m a bit surprised by some behaviour of statements with update annotations, I thought I’d share it here before filing an issue on github. Assume we have some initial data as transacted per

(asami/transact conn [{:db/ident :p1
                       :person/name "Person"}
                      {:db/ident :c1
                       :change/person {:db/ident :p1}
                       :change/time "T1"}
                      {:article/name "Article"
                       :db/ident :a1
                       :article/change {:db/ident :c1}}])
then, updating the article entity by assigning a new change, seems to drop the person entity from the db
(asami/transact conn [{:db/ident :a1
                       :article/change' {:db/ident :c2}}
                      {:db/ident :c2
                       :change/person {:db/ident :p1}
                       :change/time "T2"}])
that is (asami.core/entity db :p1) ;=> nil.

quoll 2021-04-20T12:21:55.259700Z

Thank you, but you should hold off on the accolades until I have the release out

quoll 2021-04-20T12:22:52.261300Z

I reacted poorly to the first dose of vaccine, so I’m anxious about finishing this quickly in case the second dose makes me feel unpleasant too

🤞 1
1
Andrea 2021-04-20T17:16:03.261600Z

hope I didn’t induce any rush in working on this 😞

quoll 2021-04-20T17:16:20.261800Z

It was a major bug from my perspective!

quoll 2021-04-19T15:38:12.254Z

Sigh. That’s bad

Andrea 2021-04-19T15:38:52.254400Z

I’ve digged a bit in the code and it seems this line https://github.com/threatgrid/asami/blob/2.0.0/src/asami/entities.cljc#L81 pulls in a bit too much triples to be removed

quoll 2021-04-19T15:38:59.254800Z

Let me look at the datoms those transactions generate…

Andrea 2021-04-19T15:39:35.254900Z

thank you @quoll

Andrea 2021-04-19T15:43:35.255200Z

zuko.entity.writer/existing-triples recursively follows refs apparently, right?

quoll 2021-04-19T15:45:24.255400Z

It’s recursive, but I need to check before I promise anything

Andrea 2021-04-19T15:47:22.255600Z

sure

quoll 2021-04-19T15:49:29.255800Z

yes, it recursively goes down an entire structure. That’s a bit eager. If it’s during an update then it should stop when it finds a top-level entity

quoll 2021-04-19T15:54:27.256Z

Yes, this is a definite bug. Sorry! What I’m working on can wait. I’ll get onto this right now

❤️ 3
quoll 2021-04-19T16:12:40.256300Z

https://github.com/threatgrid/zuko/issues/12

quoll 2021-04-19T16:12:50.256600Z

I think I’ve got it. Writing tests for it now

👏 1
quoll 2021-04-19T16:13:08.256800Z

(I’m slow, because I’m in a meeting)

Steven Deobald 2021-04-19T17:23:38.257100Z

@quoll I think you might be the only person I know who'd consider a 2-hour turnaround on a patch release "slow" under any circumstances, much less while multitasking. 🙂

quoll 2021-04-19T17:24:00.257300Z

Well, I AM being slow. I took lunch

😂 1
quoll 2021-04-19T17:24:06.257500Z

Back now

quoll 2021-04-19T17:24:57.257700Z

and in the middle of it all I’m having a chat with Arne Brasseur about collections documentation in Clojure

🙂 2
quoll 2021-04-19T22:29:38.258200Z

Well… in the midst of a new feature, and it’s interacting. I expect that I’ll have it done today, but it’s not as fast as I’d hoped

quoll 2021-04-19T22:29:48.258400Z

Have to cook dinner soon too!