GitHub Inbox unread count is missing digits

Have you ever encountered such a glaring UI bug, that you ask how it is possible no one has fixed it yet?

GitHub thinks I have two unread notifications. I really wish I had only two.

As of today, I have 2,240 and counting. The Inbox badge says 2. Further down the same sidebar, a single repository shows 1,680.

GitHub Notifications sidebar showing an Inbox count of 2
GitHub Notifications sidebar showing repositories unread count

Yes, I have too many unread notifications. We can have that conversation another day.

I see this bug every day and I had some time to kill this morning so, armed with OpenAI Codex, I went exploring.

GitHub sent both of these in the same response:

<!-- Mobile Inbox -->
<span class="count text-normal">2,240 </span>

<!-- Desktop Inbox -->
<span title="2" data-view-component="true" class="Counter">2</span>

The incorrect value was already in the HTML before the browser ran any scripts or laid out the page.

As you can see above, the Mobile Inbox html shows 2,240 and the repository counts also added up to 2,240. I also validated with my phone per below[1].

It shows the correct count on mobile

Retrieving through the notifications API’s pretty much confirms the total of 2k+ notifications as well.

Codex, sifted through the javascript code because we can just this nowadays (and even though we already knew that the html returned was wrong). When I told Codex to use its fetch helper directly, we still go the same mismatch.

After all this, and knowing that GitHub uses ruby, my best guess is that a .to_i is messing things up. In Ruby, "2240".to_i returns 2240, while "2,240".to_i returns 2. I can’t see the server code that produces the badge, so can’t quite be 100% but this would be a simple explanation to why this is happening.

IRB shows the string 2190 converting to 2190 and the string 2,190 converting to 2

Quite frankly, someone introducing this bug is, well, fine. Bugs exist everywhere.

What bothers me is that this bug has been present for years, and it’s still right there. The badge with the number should give me a sense of how many unread notifications I have, at a glance. Instead, I’ve learnt to ignore it.

Who at GitHub is actually using the product and paying attention to the UI?

GitHub, I’d quite like the rest of my digits back. If any GitHub engineer reads this, I beg you, either help us fix this, or write an amazing technical blog post explaining why this is harder to fix than it looks.

Either way, we all win.


1. The count is different because between me doing the above checks and remembering to do a visual check on my phone a few notifications came through
~ fin ~