osquery / osquery-site

The public website for osquery.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Star counts incorrect in community projects

zwass opened this issue · comments

I was actually looking at this today on my flight. These are all hardcoded numbers in a JSON document. Need to implement a quick get to github to grab these counts on load. Let's discuss this Monday!

As of a week or two ago these counts were updated dynamically. I wonder if there was some regression?

src/data/featured_projects.json is where this data is being parsed.

Was looking at this tonight - it appears to be working correctly.

2018-06-07 20-24-53

Does it load some default values and then try to hit the API? Is it possible there was some transient error with the API I was experiencing?

Absolutely possible. In this case, the hard-coded values would be rendered, as they are in your screenshot. We could replace all those hard coded values with an empty value, as the hard coded values are not very valuable.

BTW, this is also true for the description, owner and url. These values are all hard-coded locally and updated based on the GitHub API response. If the request fails, this other information could also, potentially, be stale.

Can we change it to be something ambiguous like question marks or something before the fetch has happened? It's pretty low on the page, so it would probably be a fine opportunity to do something async?

Yes, I have a local change for the star defaults being "--". I will get that in.

Generally the loading from Github seems to work. As of now I feel that falling back to the default hardcoded values (which represent the star counts at some time in the past) is a fine solution. We can occasionally update the hardcoded values.