From 736c3bd38835018197ca7366e97b427b02508a6c Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Sun, 9 Feb 2020 22:11:26 -0400 Subject: [PATCH] handle int32 overflow with IssueTimeline API (#2092) --- .../Clients/IssueTimelineClientTests.cs | 7 +++++++ Octokit/Models/Response/TimelineEventInfo.cs | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Octokit.Tests.Integration/Clients/IssueTimelineClientTests.cs b/Octokit.Tests.Integration/Clients/IssueTimelineClientTests.cs index cf28a45f..fce0f1cb 100644 --- a/Octokit.Tests.Integration/Clients/IssueTimelineClientTests.cs +++ b/Octokit.Tests.Integration/Clients/IssueTimelineClientTests.cs @@ -191,6 +191,13 @@ namespace Octokit.Tests.Integration.Clients Assert.Equal(anotherNewIssue.Id, timelineEventInfos[0].Source.Issue.Id); } + [IntegrationTest] + public async Task CanDeserializeIssueTimelineWhereIdPreviouslyOverflows() + { + var timelineEvents = await _issueTimelineClient.GetAllForIssue("octokit", "octokit.net", 1595); + Assert.NotEmpty(timelineEvents); + } + public void Dispose() { _context.Dispose(); diff --git a/Octokit/Models/Response/TimelineEventInfo.cs b/Octokit/Models/Response/TimelineEventInfo.cs index 081a3201..ff3b32ae 100644 --- a/Octokit/Models/Response/TimelineEventInfo.cs +++ b/Octokit/Models/Response/TimelineEventInfo.cs @@ -9,7 +9,7 @@ namespace Octokit { public TimelineEventInfo() { } - public TimelineEventInfo(int id, string nodeId, string url, User actor, string commitId, EventInfoState @event, DateTimeOffset createdAt, Label label, User assignee, Milestone milestone, SourceInfo source, RenameInfo rename) + public TimelineEventInfo(long id, string nodeId, string url, User actor, string commitId, EventInfoState @event, DateTimeOffset createdAt, Label label, User assignee, Milestone milestone, SourceInfo source, RenameInfo rename) { Id = id; NodeId = nodeId; @@ -25,7 +25,7 @@ namespace Octokit Rename = rename; } - public int Id { get; protected set; } + public long Id { get; protected set; } /// /// GraphQL Node Id