metasoarous / datsys

(+ clj cljs datomic datascript re-frame-esque-frp)
Eclipse Public License 1.0
231 stars 25 forks source link

Updates to Entity values are not persisted #39

Open fatbatman opened 7 years ago

fatbatman commented 7 years ago

After doing a git clone lein repl (run)

The Todo list shows but updates to entities fail with;

image

fatbatman commented 7 years ago

Which seems to be due to the way the logging is configured?

image

metasoarous commented 7 years ago

I don't think it has anything to do with the way logging is called. That's just the odd way exceptions bubble up in JS with try catch. I think... I could be wrong. Do you have any thoughts on this @bamarco?

fatbatman commented 7 years ago

Does anyone happen to remember the last time this working on any DatSys branch/release? It was working in an old Cayalysis branch I'd prefer not to go that far back.

fatbatman commented 7 years ago

Somewhere in the call stack a nil gets added to the server-event giving it a length of 3 and so failing the validation. I couldn't see where that was happening so it's possible it's some kind of clojurescript wierdness Anyway, this fixes it https://github.com/fatbatman/datsync/commit/ed549dd89fe2d7039149112b7fb6c5123554b89c

bamarco commented 7 years ago

@metasoarous This seems like it might be somewhere in the datview code that is confused about sente events vs datsync events, maybe?

metasoarous commented 7 years ago

@fatbatman - good find! Thanks for tracking that down! The situation is that I needed to send transaction metadata at some point, and so I added a third entry to the vector. I had it working at some point, but something else must have changed that made that break. I wasn't totally satisfied with the hack I baked in anyway though. It might be better to use a separate event name in that case, something like [:send-tx-with-metadata [tx-forms metadata]].

@bamarco - It's possible that's why this started breaking.