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

In reloadable workflow, "No queries exist for component path..." #896

Open
decoursin opened this issue Dec 14, 2017 · 0 comments
Open

In reloadable workflow, "No queries exist for component path..." #896

decoursin opened this issue Dec 14, 2017 · 0 comments

Comments

@decoursin
Copy link

decoursin commented Dec 14, 2017

When using a reloadable workflow (based on this and this), I'm getting the error:

No queries exist for component path (dashboard.core/Root dashboard.calendar/Calendar)

It seems to be caused only during the reloading phase of components of which I've modified and saved and "reloaded".

After digging a little deeper, it seems the components listed in the error message above are JS functions; so when modifying them, they change slightly, so when they're compared to the earlier-but-slightly-different-version of themselves they're no longer equal, which is what is causing the problem.

Here is some proof/examples of why this is true:

You can see the class path for (dashboard.core/Root dashboard.calendar/Calendar) is there:

=> (keys (get-in @(om/get-indexer reconciler)
                             [:class-path->query]))
([dashboard.core/Root dashboard.modal/Modal]
 [dashboard.core/Root dashboard.sidebar/Sidebar]
 [dashboard.core/Root dashboard.calendar/Calendar]
 [dashboard.core/Root])

However, when I get it, it returns nil:

=> (get-in @(om/get-indexer reconciler)
                        [:class-path->query (#'om/class-path (om/class->any reconciler Root))])
(not nil, but output elided.)

=> (get-in @(om/get-indexer reconciler)
                        [:class-path->query (#'om/class-path (om/class->any reconciler calendar/Calendar))])
nil

but it really isn't nil, I can see that by printing what's in there. You can see it by when I compare based on the name of the functions instead of the functions themselves, it works:

=> (defn to-names [coll] (map #(.-name %) coll))
=> (println (to-names (#'om/class-path (om/class->any reconciler calendar/Calendar))))
(dashboard$core$Root dashboard$calendar$Calendar)

=> (map (comp to-names first) (:class-path->query @(om/get-indexer reconciler)))
(("dashboard$core$Root" "dashboard$modal$Modal")
 ("dashboard$core$Root" "dashboard$sidebar$Sidebar")
 ("dashboard$core$Root" "dashboard$calendar$Calendar")
 ("dashboard$core$Root"))

=> (keys (into {} (map (fn [[k v]] [(map (fn [class] (.-name class))
                                                     k)
                                                v])
                                    (:class-path->query @(om/get-indexer reconciler)))))
(("dashboard$core$Root" "dashboard$modal$Modal")
 ("dashboard$core$Root")
 ("dashboard$core$Root" "dashboard$calendar$Calendar")
 ("dashboard$core$Root" "dashboard$sidebar$Sidebar"))

=> (get (into {} (map (fn [[k v]] [(map (fn [class] (.-name class))
                                                           k)
                                                      v])
                                         (:class-path->query @(om/get-indexer reconciler))))
                           (to-names (#'om/class-path (om/class->any reconciler calendar/Calendar))))
(output elided but you can trust me, the stuff's there.)
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