asami 2021-04-19

👋 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.

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

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

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

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

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

❤️ 3

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

👏 1

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

@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. 🙂

Well, I AM being slow. I took lunch

😂 1

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

🙂 2

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

Have to cook dinner soon too!

Looks good in Zuko right now. But there were a number of changes there that affect Asami tests, and I need to work through those. I’ll get to that in the morning (there may be delays as I have a vaccine appointment tomorrow morning)

@quoll you're a war machine. 💪

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

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

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

It was a major bug from my perspective!

Sigh. That’s bad

Let me look at the datoms those transactions generate…