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

Commit 5ee352a

Browse files
committed
Order comments when building comment threads.
Looks like the API has started returning pending comments out of order, so order by `CreatedAt` client-side.
1 parent 00765c6 commit 5ee352a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GitHub.InlineReviews/Services/PullRequestSessionService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ static void BuildPullRequestThreads(PullRequestDetailModel model)
845845
}
846846

847847
// Get the comments that are replies and place them into the relevant list.
848-
foreach (CommentAdapter comment in model.Reviews.SelectMany(x => x.Comments))
848+
foreach (CommentAdapter comment in model.Reviews.SelectMany(x => x.Comments).OrderBy(x => x.CreatedAt))
849849
{
850850
if (comment.ReplyTo != null)
851851
{

0 commit comments

Comments
 (0)