octokit.net: [BUG]: Error deserializing new issues

What happened?

I’ve begun noticing errors deserializing the issue ID number when receiving issue webhooks. The value appears to be an int in the models but it seems GitHub has finally crossed the threshold and needs a long. My internal issue ID number was 2147620872, and the log was for a comment created webhook request.

Versions

1.0.0 (we haven’t upgraded in a while) but bug appears to still be present in the main branch

Relevant log output

JSON integer 2147620872 is too large or small for an Int32. Path 'issue.id', line 1, position 612.
  at Newtonsoft.Json.JsonTextReader.ParseReadNumber(ReadType readType, Char firstChar, Int32 initialPosition)\n   at Newtonsoft.Json.JsonTextReader.ReadNumberValue(ReadType readType)\n   at Newtonsoft.Json.JsonTextReader.ReadAsInt32()

Code of Conduct

  • I agree to follow this project’s Code of Conduct

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 19
  • Comments: 18 (2 by maintainers)

Most upvoted comments

Waiting for a hotfix here 👀

now that #2060 and #2092 are merged and (ignore, those were historical references) #2890 is approved, is the confidence high that everything is fixed❔ if yes, how soon should that hotfix be available❔

IssueComment Id should be long as well, because we are at 1.900.000.000

@JimSuplizio, the core issue is that Octokit uses int for Id, where the maximum is 2,147,483,647, and the GitHub issue ID has just surpassed that number, causing deserialization to fail. This will also become a problem for comments and other elements, although comments still have about 163 million comments to go before it becomes an issue 😬

@brantburnett if the underlying API for integer is int64 then I stand corrected as that would be a non-issue. It doesn’t change the fact that just changing Issue’s ID would be enough. I am using these classes for both deserialization and modifying issues, it can’t be a partial fix just for deserialization, that int->long would need to be made to every class that’s using an int Issue number.

It’s also unclear if this is actually an issue with Octokit which needs to be fixed or if this is an issue with GitHub, itself, that needs to be fixed on their end. Being that this started happening about 24 hours ago, it seems like someone made a change to allow long Issue IDs and broke this and the fix might end up being there. shrug At this point, who can say?

I don’t believe this PR is the right fix. Changing the Id to long isn’t going to change the underlying APIs that use this Id, which will still expect integers. It’s unclear if this is somehow a problem with GitHub’s issue numbering but I believe just changing things to longs might not be the right thing if the underlying API doesn’t support it.

The underlying API spec appears to indicate that it is an int64 to me:

{
  "title": "Issue",
  "description": "Issues are a great way to keep track of tasks, enhancements, and bugs for your projects.",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64"
    },