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

Occasionally doesn't show my full streak stats, just truncated ones #288

Open
unixorn opened this issue Jul 29, 2022 · 11 comments
Open

Occasionally doesn't show my full streak stats, just truncated ones #288

unixorn opened this issue Jul 29, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@unixorn
Copy link

unixorn commented Jul 29, 2022

Describe the bug

Occasionally when I view my profile, the streak stats only go back to Feb 2016. Usually it's correct and shows back to 2014, but every so often I see it truncated.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://github.com/unixorn?tab=overview&from=2014-12-01&to=2014-12-31
  2. View the inline streak stats chart

Unfortunately it's intermittent, that will usually show the correct stats, it's only occasionally truncated.

Expected behavior

I expect it to always show the same correct stats

Screenshots
incomplete-streak

Desktop (please complete the following information):

  • OS: macOS 12.5 (happened on 12.4 too)
  • Browser - I've seen it happen on both Chrome and Firefox

Additional context
Add any other context about the problem here.

@unixorn unixorn added the bug Something isn't working label Jul 29, 2022
@DenverCoder1
Copy link
Owner

DenverCoder1 commented Jul 29, 2022

The stats displayed on the card are directly from the GitHub API.

The reason this may happen is possibly due to timezone-related issues.

It seems from experimenting that the timezone used for the contribution dates is based on the user's last known timezone for the access token provided. I found that 2 of the tokens in the public token pool were last used in a different timezone, but the other four were last used in Denver. To attempt to fix the issue, I've made sure the other two tokens were used in Denver (where I'm located) so it should at least be consistent. (Note: due to caching it may take some time for this to go into effect).

If you self-host the cards using your own personal access token, it would likely resolve the issue as well.

Let me know if this helps or if you continue experiencing the issue.

@unixorn
Copy link
Author

unixorn commented Jul 30, 2022

Will do and thanks for looking into it. Since it's an intermittent thing, it's hard to check.

@DenverCoder1
Copy link
Owner

DenverCoder1 commented Aug 1, 2022

I mentioned the issue to GitHub Support and they told me "all timestamps are in UTC and this is the expected behavior". If the ability to switch the timezone ever becomes possible, I will be sure to implement it, but for now it seems it is not.

You could always change the dates of commits to fill in the gaps if you think it should count when it didn't, but besides that I can't think of anything.

I'm still not sure why it would be intermittent, though, but I can't really make it any more reliable than the API itself.

@unixorn
Copy link
Author

unixorn commented Aug 1, 2022

Agreed, if the API is inconsistent you can't do much to cope with it.

@sumanabhi
Copy link

Hey @DenverCoder1,

I'm also having the same issue, How I can host the card by myself or how we can change it if I want to update the same?
Screenshot 2022-08-03 at 5 04 25 PM
Screenshot 2022-08-03 at 5 23 36 PM

@DenverCoder1
Copy link
Owner

DenverCoder1 commented Aug 3, 2022

I'm also having the same issue, How I can host the card by myself or how we can change it if I want to update the same?

The issue again is that the GitHub API says that you have 0 contributions on August 2 even though the graph displays differently.

Based on the response from GitHub Support, I'm not sure that self hosting would make a difference, but if you want to try it anyway, there are instructions in the readme.

The only way I can think of is to either change the date of a past commit or create a new commit dated in the middle of the day on the day that is missing, for example

git commit --date="2022-08-02 12:00" -m "Test commit" --allow-empty

You may consider this to be "cheating" but for now there doesn't seem to be another way to make GitHub count it.

@Yohn
Copy link

Yohn commented Aug 21, 2022

I just had this timezone thing happen to me.

Its still Aug. 20th, but its showing its the 21st on the pic..
WrongTimezone

@jgphilpott
Copy link
Contributor

Definitely an intermittent issue, im getting it today but havent seen it in a long time. Seems like an issue with the GitHub API intermittently providing inaccurate/incomplete data. Just gotta wait it out I guess, will be back to normal by tomorrow I hope!

@eswat2
Copy link

eswat2 commented Nov 16, 2022

i'm seeing something similar on my stats. As of just last week, my longest streak was 455, but today it's showing 293 and that appears to be capped by this year (1.1 - 10.20). My longest streak was actually beyond that...

Also, my total contributions seem to be capped for this year as well and i believe it use to be counted over a longer span.

@jgphilpott
Copy link
Contributor

eswat2

I think all you can do is just wait and it will go back to normal eventually ... seems like the issue is on GitHub's end.

@DenverCoder1
Copy link
Owner

I recently discovered that occasionally the GitHub API was returning blank responses when several requests were sent in a short amount of time, possibly due to rate-limiting.

I have done some testing over the past few days and I believe most of the issues people have been having with missing contributions from past years should be resolved now. In #370, I made it so it will retry requests once if they fail which should greatly reduce the amount of times the streak is missing stats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants