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

Page loading issue #15

Open
aquaticrna opened this issue Jun 3, 2016 · 4 comments
Open

Page loading issue #15

aquaticrna opened this issue Jun 3, 2016 · 4 comments

Comments

@aquaticrna
Copy link
Contributor

Bizarre issue where, sometimes, the page won't finish loading until you go back to the source file and save to force figwheel to update the page

@metasoarous
Copy link
Owner

It seems like manually running lein cljsbuild once sometimes fixes this as well. But would appreciate confirmation from others on this. Hopefully the extraction I'm working on will resolve this issue by properly orchestrating app startup. (I have a feeling this is just a state-dependency issue, where things aren't booting properly). Enter SS Component...

@bamarco
Copy link
Collaborator

bamarco commented Jun 17, 2016

[UPDATE
My bad. There's a difference between the meta on an atom and the db-data inside the atom. Back to the drawing board.]

If you look at view.cljs where posh! gets called in Datview if you add a (log/info "posh-meta" (meta conn)) you'll see listeners. But by the time the go-react loop in reactor.cljc gets called the posh-meta is gone.

So it looks like somewhere in the event loop posh's metadata gets clobbered which is what posh uses to make reactions work for queries.

@bamarco
Copy link
Collaborator

bamarco commented Jun 18, 2016

@metasoarous
Partial fix:

If you replace

(defn type-instance-eids-rx
  [app type-ident]
  (posh/q-tx (:conn app)
             '[[_ :e/type ]]
          '[:find ?e
            :in $ ?type
            :where [?e :e/type ?type]
            ]
          [:db/ident type-ident]
          ))

in dat.sys.client.views.cljs part of the problem will be fixed (css not loading automatically so I'm guessing it gets generated elsewhere with a similar :db/ident query).

This works because posh doesn't handle idents properly when it calls q-gen/q-pattern-gen or possibly when it's doing the pattern matching later. So I just replaced the genpattern with a less restrictive pattern to make sure it gets updated. This will have performance issues if left this way.

@metasoarous
Copy link
Owner

For the record, we think this is a bug in posh. The updated version @mpdairy is working on should fix this. Crossing fingers...

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

3 participants