Fix comment links for robot comments
Release-Notes: skip
Google-Bug-Id: b/267281444
Change-Id: I14b31944ed02da1c025f21e73d5c24a807c6cc71
diff --git a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
index 264560b..3dbd1a0 100644
--- a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
+++ b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
@@ -1329,10 +1329,15 @@
const repo = ctx.params[0] as RepoName;
const commentId = ctx.params[2] as UrlEncodedCommentId;
- const comments = await this.restApiService.getDiffComments(changeNum);
- const change = await this.restApiService.getChangeDetail(changeNum);
+ const [comments, robotComments, change] = await Promise.all([
+ this.restApiService.getDiffComments(changeNum),
+ this.restApiService.getDiffRobotComments(changeNum),
+ this.restApiService.getChangeDetail(changeNum),
+ ]);
- const comment = findComment(addPath(comments), commentId);
+ const comment =
+ findComment(addPath(comments), commentId) ??
+ findComment(addPath(robotComments), commentId);
const path = comment?.path;
const patchsets = computeAllPatchSets(change);
const latestPatchNum = computeLatestPatchNum(patchsets);