Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit d66aac3

Browse files
committed
Only fetch IssueComment and PullRequestCommit items
1 parent 46e06b5 commit d66aac3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/GitHub.InlineReviews/Services/PullRequestSessionService.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ public virtual Task<PullRequestDetailModel> ReadPullRequestDetail(HostAddress ad
306306
async Task<PullRequestDetailModel> ReadPullRequestDetailWithResolved(HostAddress address, string owner,
307307
string name, int number, bool refresh)
308308
{
309+
var itemTypes = new[] { PullRequestTimelineItemsItemType.IssueComment, PullRequestTimelineItemsItemType.PullRequestCommit };
310+
309311
if (readPullRequestWithResolved == null)
310312
{
311313
readPullRequestWithResolved = new Query()
@@ -383,7 +385,7 @@ async Task<PullRequestDetailModel> ReadPullRequestDetailWithResolved(HostAddress
383385
AvatarUrl = review.Author.AvatarUrl(null)
384386
}
385387
}).ToList(),
386-
Timeline = pr.TimelineItems(null, null, null, null, null, null, null).AllPages().Select(item => item.Switch<object>(when =>
388+
Timeline = pr.TimelineItems(null, null, null, null, itemTypes, null, null).AllPages().Select(item => item.Switch<object>(when =>
387389
when.PullRequestCommit(commit => new CommitModel
388390
{
389391
AbbreviatedOid = commit.Commit.AbbreviatedOid,
@@ -490,6 +492,8 @@ async Task<PullRequestDetailModel> ReadPullRequestDetailWithResolved(HostAddress
490492
async Task<PullRequestDetailModel> ReadPullRequestDetailWithoutResolved(HostAddress address, string owner,
491493
string name, int number, bool refresh)
492494
{
495+
var itemTypes = new[] { PullRequestTimelineItemsItemType.IssueComment, PullRequestTimelineItemsItemType.PullRequestCommit };
496+
493497
if (readPullRequestWithoutResolved == null)
494498
{
495499
readPullRequestWithoutResolved = new Query()
@@ -562,7 +566,7 @@ async Task<PullRequestDetailModel> ReadPullRequestDetailWithoutResolved(HostAddr
562566
Url = comment.Url,
563567
}).ToList(),
564568
}).ToList(),
565-
Timeline = pr.TimelineItems(null, null, null, null, null, null, null).AllPages().Select(item => item.Switch<object>(when =>
569+
Timeline = pr.TimelineItems(null, null, null, null, itemTypes, null, null).AllPages().Select(item => item.Switch<object>(when =>
566570
when.PullRequestCommit(commit => new CommitModel
567571
{
568572
AbbreviatedOid = commit.Commit.AbbreviatedOid,

0 commit comments

Comments
 (0)