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

Comments count is off #18

Open
burntcookie90 opened this issue Jan 25, 2016 · 2 comments
Open

Comments count is off #18

burntcookie90 opened this issue Jan 25, 2016 · 2 comments
Labels

Comments

@burntcookie90
Copy link
Contributor

story 10963568 from /news shows 187 comments but hitting item/10963568 shows only 9 for comments_count

see: https://whispering-fortress-7282.herokuapp.com/news
and: https://whispering-fortress-7282.herokuapp.com/item/10963568

@cheeaun cheeaun added the bug label Jan 25, 2016
@cheeaun
Copy link
Owner

cheeaun commented Jan 25, 2016

So let me explain this; the cause of the bug is mainly from Firebase HN API sometimes returning 401 (Permission denied) responses for some of the comments. For the past few changes that I've committed, I purposely set a timeout for every single request to Firebase. If it's too slow, due to too many comments, it'll just silently fail. If it's 401, due to Firebase's weird bug, it'll also silently fail.

Before this solution, the whole request on the API (this one, not HN) fails, so I decided that it's still better to return some comments rather than none. Thus, explains why the comment count is wrong.

I'm not sure how to fix this, but hoping that it'll be fixed on Firebase side. Probably this one: HackerNews/API#6

@burntcookie90
Copy link
Contributor Author

Yeah I figured it was something similar, with the lack of updates on the hacker news firebase side, does it make sense to not use a scraper?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants