Skip to content

Commit

Permalink
Never send :dat.sync.remote.db/id to remote
Browse files Browse the repository at this point in the history
  • Loading branch information
metasoarous committed Nov 4, 2016
1 parent 0fc7139 commit 4c75956
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/dat/sync/client.cljc
Expand Up @@ -483,10 +483,15 @@
;; just like you can for the client XXX
;; Needs to be reworked overall as well

;; Need to rename to remote-tx

(defn datomic-tx
[db tx]
(let [tx (normalize-tx tx)
ids (map second tx)
(let [tx (->> (normalize-tx tx)
(remove
(fn [[_ _ a]]
;; This is something that should never exist on the server
(#{:dat.sync.remote.db/id :db/id} a))))
translated-tx (d/q '[:find ?op ?dat-e ?a ?dat-v
:in % $ [[?op ?e ?a ?v]]
:where [(get-else $ ?e :dat.sync.remote.db/id ?e) ?dat-e]
Expand Down Expand Up @@ -514,7 +519,7 @@
(not= ?vt-ident :db.type/ref)
[(ground ?ds-v) ?datomic-v]]]
db tx)]
(vec (remove #(= (nth % 2) :db/id) translated-tx))))
(vec translated-tx)))



Expand Down

0 comments on commit 4c75956

Please sign in to comment.