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

Commit 20cfb4e

Browse files
committed
Use PR model returned from CancelPendingReview.
Previously we were ignoring the new PR model, and instead mutating the current PR model (wrongly) causing the crash in #1847. Fixes #1847
1 parent c3acc5d commit 20cfb4e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/GitHub.InlineReviews/Services/PullRequestSession.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,8 @@ public async Task CancelReview()
230230
throw new InvalidOperationException("There is no pending review to cancel.");
231231
}
232232

233-
await service.CancelPendingReview(LocalRepository, PendingReviewId);
234-
235-
PullRequest.Reviews = PullRequest.Reviews
236-
.Where(x => x.Id != PendingReviewId)
237-
.ToList();
238-
239-
await Update(PullRequest);
233+
var pullRequest = await service.CancelPendingReview(LocalRepository, PendingReviewId);
234+
await Update(pullRequest);
240235
}
241236

242237
/// <inheritdoc/>

0 commit comments

Comments
 (0)