-
-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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
Include_all_commits
sometimes shows incorrect number of commits
#1515
Comments
Include_all_commits
sometimes shows incorrect number of commits
@nasw1j, I checked the codebase, and I think both github-readme-stats/src/fetchers/stats-fetcher.js Lines 155 to 163 in 9a909ff
I, therefore, think the error is caused by incorrect data returned from GitHub's REST API and GraphQL API APIs. If this happens, these wrong values are cached for 4 hours. github-readme-stats/api/index.js Lines 60 to 64 in 9a909ff
When this happens, you can check the console.log to see if there is any error and use the Detailed explanationIf github-readme-stats/src/fetchers/stats-fetcher.js Lines 69 to 100 in 9a909ff
This will then be used as the total commits. To this value, the private commits will be correctly added if Posible solutionsWe can use the previous cache when this problem happens. |
I quickly checked #1691 created by @Rongronggg9 and think merging to his pull request will significantly improve the commit accuracy. I, however, did not have time to do a thorough review 😅. Nevertheless, still, one problem persists with #1691 merged. It will show a commit count of github-readme-stats/api/index.js Line 66 in 9a909ff
Maybe this can be achieved by changing the cache header when the Rest API fails (see https://vercel.com/docs/concepts/edge-network/caching). |
I see. I will find some time to take a look at it. |
@Rongronggg9 No pressure your PR looks very promising, take your time! 🚀 |
@Rongronggg9 See #2177 and 4df8094 for a example on how to purge the cache when the GraphQL and Rest api fail. Further, please read #211 because we are currently not fetching commits by year. In short, this is because we are trying to prevent the GraphQL and Vercel timeout limits from reaching. I think we could add this more accurate commit fetching, but it should be disabled by default to prevent any rate limits from being hit on the Public Vercel instance. I"m doing something similar on #2159. |
I created community/community#35675 to ask GitHub to make the |
For future reference, a (draft) PR to improve this behaviour can be found at #2448. |
As pointed out by @Madhav-MKNC in #2851 (comment), for some accounts the total commit count is lower than the yearly commit count. This is also caused by the use of the GitHub Search API, which is known to be buggy.
If you want this fixed please add your support to https://github.com/orgs/community/discussions/35675 so we can fix this in the future 🙏🏻. Furthermore, this behaviour will be improved when the GitHub action is released with #1691 merged under an environmental variable. |
The behavoir should be improved when
are merged. |
I am facing the issue still my commit count are significantly lower than actual ones. |
Describe the bug
On GitHub Stats the number of commits is currently showing the last years commits, after adding
include_all_commits
it decreases as shown below.Expected behaviour
Shows the number of commits in 2022
Screenshots / Live demo link (paste the github-readme-stats link as markdown image)
Before adding


include_all_commits
After adding
include_all_commits
The text was updated successfully, but these errors were encountered: