ribelo / doxa

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

commit stops denorm when it finds a map without an id

stevebuik opened this issue · comments

(dx/create-dx [{:event/id 1
                :name     "Olympics"
                :sports   {:page/id 1                       ; << remove to see bug
                           :total   10
                           :fetched [{:sport/id 2
                                      :name     "Boardercross"}
                                     {:sport/id 3
                                      :name     "Curling"}]}}]
              {::dx/with-diff? true})

while it's easy to workaround by adding fake ids to every map, it would be much less brittle for early
users if it could handle a deeply nested commit where some of the maps didn't need/have idents

doxa allows to hold nested maps. normalization is user-dependent and only those maps that have a key that satisfies the condition (= "id" (name k)) will be considered as entities. this is a feature, not a bug (:

I understand the principle but...

if you could allow this without any negative effects, it would make life easier for any dev starting with Doxa and is not fully aware of this restriction.

also, a side effect of the lack of norm is that pull results come back incorrect and the reason for it is not obvious.

feel free to close this if you want. I understand it, just thinking of others