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

Error when transacting empty collections at leaf of Causal Map #16

Open
bobby opened this issue Mar 25, 2020 · 0 comments
Open

Error when transacting empty collections at leaf of Causal Map #16

bobby opened this issue Mar 25, 2020 · 0 comments

Comments

@bobby
Copy link
Contributor

bobby commented Mar 25, 2020

There are several reasons why we'd want to start a CausalBase with empty leaf collections, including initializing a new data structure. Currently we're unable to do so.

Repro:

(require '[causal.core :as cause])
(def db (cause/base))
(cause/transact db [[nil nil {:foo {}}]])
=> Error: The cause of this node is not in the tree.
    at new cljs$core$ExceptionInfo (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:37198:10)
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:37259:9)
    at Function.cljs$core$IFn$_invoke$arity$2 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:37255:26)
    at Function.cljs$core$IFn$_invoke$arity$4 (http://localhost:8000/js/compiled/cljs-runtime/causal.collections.shared.js:292:25)
    at Object.causal$protocols$CausalTree$insert$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/causal.collections.map.js:542:79)
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/causal.protocols.js:168:19)
    at http://localhost:8000/js/compiled/cljs-runtime/causal.base.core.js:191:32
    at http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:19649:89
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:19650:3)
    at Function.cljs$core$IFn$_invoke$arity$3 (http://localhost:8000/js/compiled/cljs-runtime/cljs.core.js:19646:78)

*e
=> #error {:message "The cause of this node is not in the tree.", :data {:causes #{:cause-must-exist}}}
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

1 participant