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

problem: [currency] SubsCache.ready() always returning false #1068

Closed
AshHimself opened this issue Apr 11, 2018 · 25 comments
Closed

problem: [currency] SubsCache.ready() always returning false #1068

AshHimself opened this issue Apr 11, 2018 · 25 comments
Labels
done Marks an issue that's solved and ready for testing.

Comments

@AshHimself
Copy link
Member

Problem: SubsCache.ready() always returning false therefore the LOADING indicator never goes.

Solution: Unknown

@AshHimself
Copy link
Member Author

AshHimself commented Apr 11, 2018

#1057 seems to be the last PR I can see that it was working.

Looping through all subcaches ready status presents Ready for all subs.

_.values(SubsCache.cache).map(function(x) {console.log (x.ready()); })

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

I actually turned on SubsCache in #1052.

@AshHimself
Copy link
Member Author

AshHimself commented Apr 11, 2018 via email

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

Would you like me to find out?

@AshHimself
Copy link
Member Author

AshHimself commented Apr 11, 2018 via email

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

@blockrazorbot claim

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

Is upstream issue: ccorcos/meteor-subs-cache#20

this is workaround: _(SubsCache.cache).chain().values().map((x) => x.ready()).reduce((a,b) => a && b).value()
@gazhayes should I look into merging this into our subsCache. What does "_" and chain() mean?

@AshHimself
Copy link
Member Author

AshHimself commented Apr 11, 2018

I honetly think its working its just the reactiveVar isn't getting updated.

https://github.com/ccorcos/meteor-subs-cache/blob/07a13c0de27dcf9c81e3874edce3df6887cc02d0/src/SubsCache.js#L246

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

the issue is exclusive to this route though.

@AshHimself
Copy link
Member Author

Does enabling debug bring anymore light to the issue?

SubsCache = new Sub(5, 10, true);

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

Some subscriptions don't pass in params when they should.

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

Stops a bunch of subscriptions.

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

I replied in upstream issue, and we kind of have a workaround. @blockrazorbot unclaim

@gsovereignty
Copy link
Member

@janat08 are they fixing it upstream? Or if you know how to fix it just pull request to our version.

@AshHimself
Copy link
Member Author

AshHimself commented Apr 11, 2018

@gazhayes I believe @janat08 may of resolved the issue in #1070 waiting on merge from you to confirm.

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

That doesn't resolve.

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

_(SubsCache.cache).chain().values().map((x) => x.ready()).reduce((a,b) => a && b).value()

Will return true value, but I don't know what this means.

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

They have an issue for it, I guess they'd like to.

@gsovereignty
Copy link
Member

gsovereignty commented Apr 11, 2018

_(SubsCache.cache).chain().values().map((x) => x.ready()).reduce((a,b) => a && b).value()

Will return true value, but I don't know what this means.

You mean because you aren't sure what it's doing upstream or just because it's confusing?
It's Functionalized ES6, @anbud can probably explain this to you better than I can.

They have an issue for it, I guess they'd like to.

Don't count on them fixing it, if you can do it just do it.

@anbud
Copy link
Member

anbud commented Apr 11, 2018

The functional code you've posted above just checks if all caches are ready (map maps them to x.ready() and reduce checks if all of them are true, if any of them is not ready, reduce will return false, otherwise the result is true).

@janat08
Copy link
Collaborator

janat08 commented Apr 11, 2018

@anbud
Copy link
Member

anbud commented Apr 11, 2018

The only difference between the two is that the one you've posted above uses underscore/lodash chaining and respective map and reduce, while the original code uses native js map and reduce. This shouldn't make any difference though, but I'm guessing it does.

@samuelralak
Copy link
Member

this issue is not exclusive to the /currency route, I have also spotted it in /problems/:id

the issue is exclusive to this route though.

@janat08
Copy link
Collaborator

janat08 commented Apr 12, 2018

Couldn't reproduce in /problems/:id. This is just for subs-cache not working. Did you mean #1051?

@janat08
Copy link
Collaborator

janat08 commented Apr 20, 2018

@blockrazorbot label "done", resolution in #1196

@blockrazorbot blockrazorbot added the done Marks an issue that's solved and ready for testing. label Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Marks an issue that's solved and ready for testing.
Projects
None yet
Development

No branches or pull requests

6 participants