Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid refs (tempids) are transacted without error #304

Closed
ash14 opened this issue May 30, 2019 · 1 comment
Closed

Invalid refs (tempids) are transacted without error #304

ash14 opened this issue May 30, 2019 · 1 comment

Comments

@ash14
Copy link
Contributor

ash14 commented May 30, 2019

Datascript (0.18.3) accepts transaction data that contain invalid refs:

(-> (d/empty-db {:x {:db/valueType :db.type/ref}})
    (d/with [[:db/add -1 :x "?"]]))

; =>
#datascript.db.TxReport
 {:db-before #datascript/DB
              {:schema {:x #:db{:valueType :db.type/ref}} :datoms []}
  :db-after #datascript/DB
             {:schema {:x #:db{:valueType :db.type/ref}}
              :datoms [[2 :x 1 536870913]]}
  :tx-data [#datascript/Datom [2 :x 1 536870913 true]]
  :tempids {"?" 1 -1 2 :db/current-tx 536870913}
  :tx-meta nil}

In a similar set up Datomic will throw ":db.error/tempid-not-an-entity tempid used only as value in transaction"

@tonsky
Copy link
Owner

tonsky commented May 30, 2019

Thanks! Might be worth fixing, yes

@tonsky tonsky added this to the Summer of Bugs milestone Jun 24, 2020
@tonsky tonsky closed this as completed in 7dfff2c Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants