Skip to content

Commit

Permalink
Prevent overflow exceptions when status id > int.Max
Browse files Browse the repository at this point in the history
I have a (private) repository where GitHub reports statuses with
ids like 4299360515, which fail to deserialize as it doesn't fit
on the int.

There is nothing (I could find) on the GitHub API docs that say
that this status id is limited to an int-sized value.

Fixes octokit#1702
  • Loading branch information
kzu committed Nov 6, 2017
1 parent 73679d0 commit 2917b44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Octokit/Models/Response/CommitStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class CommitStatus
{
public CommitStatus() { }

public CommitStatus(DateTimeOffset createdAt, DateTimeOffset updatedAt, CommitState state, string targetUrl, string description, string context, int id, string url, User creator)
public CommitStatus(DateTimeOffset createdAt, DateTimeOffset updatedAt, CommitState state, string targetUrl, string description, string context, long id, string url, User creator)
{
CreatedAt = createdAt;
UpdatedAt = updatedAt;
Expand Down Expand Up @@ -57,7 +57,7 @@ public CommitStatus(DateTimeOffset createdAt, DateTimeOffset updatedAt, CommitSt
/// <summary>
/// The unique identifier of the status.
/// </summary>
public int Id { get; protected set; }
public long Id { get; protected set; }

/// <summary>
/// The URL of the status.
Expand Down

0 comments on commit 2917b44

Please sign in to comment.