sciencefair-land / sciencefair

The futuristic, fabulous and free desktop app for working with scientific literature :microscope: :book:
https://sciencefair-app.com
MIT License
604 stars 52 forks source link

Dev build stuck on 0% syncing initial data #77

Closed jacobrosenthal closed 7 years ago

jacobrosenthal commented 7 years ago

Havent figured this out on my own yet so Ill just post.

After launch Im stuck on 0% syncing initial data.

Dev tools shows error every second

/Users/jacobrosenthal/Downloads/sciencefair/app/node_modules/raven-js/src/raven.js:325 Uncaught TypeError: Cannot read property 'finished' of undefined
    at ds (/Users/jacobrosenthal/Downloads/sciencefair/app/client/models/datasources.js:156)
    at arraySome (/Users/jacobrosenthal/Downloads/sciencefair/app/node_modules/lodash/_arraySome.js:16)
    at some (/Users/jacobrosenthal/Downloads/sciencefair/app/node_modules/lodash/some.js:48)
    at poll (/Users/jacobrosenthal/Downloads/sciencefair/app/client/models/datasources.js:156)
    at wrapped (/Users/jacobrosenthal/Downloads/sciencefair/app/node_modules/raven-js/src/raven.js:321)

I think here but havent figured out what to do yet. https://github.com/codeforscience/sciencefair/blob/master/app/client/models/datasources.js#L156

blahah commented 7 years ago

@jacobrosenthal sorry for the trouble and thanks for the report! I think this should do it:

    const anyfinished = any(news, ds => ds.stats.get('metadataSync').value().finished)

I must have left that call over from a time when Datasource.stats was a simple object - now it's a lowdb

blahah commented 7 years ago

I was wrong - the datasources code is correct, but lowdb's behaviour changed in a way I didn't realise between versions. Fix incoming.

jacobrosenthal commented 7 years ago

I appear to sync all data now, but I have 0 data sources, and searching for crispr, as in the last published release I still have on my computer, I get 0 results so I have a feeling there may still be something wrong with datasets?


20:31:59 ✨ choo results:count Object {count: 0, source: "collection"}
/Users/jacobrosenthal/Downloads/sciencefair/app/node_modules/raven-js/src/console.js:26 20:31:59 🐛 choo [model:results] 0 results in collection for 'crispr' undefined
/Users/jacobrosenthal/Downloads/sciencefair/app/node_modules/raven-js/src/console.js:26 20:31:59 ✨ choo render 60fps 3ms```
blahah commented 7 years ago

If you click on datasources, it will be there I think but turned off - it should of course be on by default, fixing that now. Turning it on should make search work

blahah commented 7 years ago

fix pushed to master, but will only apply to clean runs (after deleting ~/.sciencefair) or newly added datasources

clicking on the circle to the left of the datasource entry will toggle it on and off:

screen shot 2017-06-19 at 04 19 08

jacobrosenthal commented 7 years ago

Can confirm it was datasource disabled, and that by default it is now enabled. Thanks.