I feel like I'm missing something. We have a situation where the incoming data was marked as not-found (correctly), and then merge* does not sweep.
(def person-id (random-uuid))
(def person-ident (comp/get-ident Person {:person/id person-id}))
(defsc Person
[this props]
{:ident :person/id
:query [:person/id
:person/name
{:person.preferences/latest [:person.preferences.likes/pizza?]}]})
(let [state-map {:person/id {person-id {}}}
query [{person-ident (comp/get-query Person)}]
result-tree {person-ident
{:person/name :com.fulcrologic.fulcro.algorithms.merge/not-found ; Sweeps ✅
:person/surname "Doe"
:person.preferences/latest {:person.preferences.likes/pizza?
; Expect this to be sweeped?
:com.fulcrologic.fulcro.algorithms.merge/not-found}}}]
(com.fulcrologic.fulcro.algorithms.merge/merge*
state-map
query
result-tree))We get
{:person/id {#uuid"e8b276ae-bf49-4b92-a4ab-87bebfdaa01f" {:person/surname "Doe",
:person.preferences/latest {:person.preferences.likes/pizza? :com.fulcrologic.fulcro.algorithms.merge/not-found}}}}did you figure it out?
Not yet, I thought it was because the join was incomplete, and that this (shape) would work:
(defsc PersonPreferences
[this props]
{:query [:person.preferences.likes/pizza?]})
(defsc Person
[this props]
{:ident :person/id
:query [:person/id
:person/name
{:person.preferences/latest (comp/get-query PersonPreferences)}]})
It does not seem to, :person.preferences.likes/pizza? remains unsweepedunsweeped when?
on a load, or just on your manual call
you have to use merge-component! or load! if you want Fulcro to sweep I think
I still have to unpack the pieces to give a clear answer and decent repro. This is a load! - and I am currently suspicious that we are doing something too-funky that breaks it
you HAVE to use get-query ….you cannot make a manual join like that in sample code.
try (mege* state-map (comp/get-query Person) person-map)
oh wait
what you are showing is right…sweep happens in a later stage of the load logic I think
I’d have to look at the logic again, but you can look at the source where the mark/sweep is implemented