@@ -564,7 +564,7 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
564564
565565 this . hasPendingReview = false ;
566566 await this . updateDraftModeContext ( ) ;
567- const reviewEvent = parseGraphQLReviewEvent ( data ! . submitPullRequestReview . pullRequestReview , this . githubRepository ) ;
567+ const reviewEvent = await parseGraphQLReviewEvent ( data ! . submitPullRequestReview . pullRequestReview , this . githubRepository ) ;
568568
569569 const threadWithComment = ( this . _reviewThreadsCache ?? [ ] ) . find ( thread =>
570570 thread . comments . length ? ( thread . comments [ 0 ] . pullRequestReviewId === reviewEvent . id ) : undefined ,
@@ -649,7 +649,7 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
649649 } ) ;
650650
651651 const { comments, databaseId } = data ! . deletePullRequestReview . pullRequestReview ;
652- const deletedReviewComments = comments . nodes . map ( comment => parseGraphQLComment ( comment , false , false , this . githubRepository ) ) ;
652+ const deletedReviewComments = await Promise . all ( comments . nodes . map ( comment => parseGraphQLComment ( comment , false , false , this . githubRepository ) ) ) ;
653653
654654 // Update local state: remove all draft comments (and their threads if emptied) that belonged to the deleted review
655655 const deletedCommentIds = new Set ( deletedReviewComments . map ( c => c . id ) ) ;
@@ -772,7 +772,7 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
772772 }
773773
774774 const thread = data . addPullRequestReviewThread . thread ;
775- const newThread = parseGraphQLReviewThread ( thread , this . githubRepository ) ;
775+ const newThread = await parseGraphQLReviewThread ( thread , this . githubRepository ) ;
776776 if ( ! this . _reviewThreadsCache ) {
777777 this . _reviewThreadsCache = [ ] ;
778778 }
@@ -824,7 +824,7 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
824824 }
825825
826826 const { comment } = data . addPullRequestReviewComment ;
827- const newComment = parseGraphQLComment ( comment , false , false , this . githubRepository ) ;
827+ const newComment = await parseGraphQLComment ( comment , false , false , this . githubRepository ) ;
828828
829829 if ( isSingleComment ) {
830830 newComment . isDraft = false ;
@@ -1023,7 +1023,7 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
10231023 throw new Error ( 'Editing review comment failed.' ) ;
10241024 }
10251025
1026- const newComment = parseGraphQLComment (
1026+ const newComment = await parseGraphQLComment (
10271027 data . updatePullRequestReviewComment . pullRequestReviewComment ,
10281028 ! ! comment . isResolved ,
10291029 ! ! comment . isOutdated ,
@@ -1341,7 +1341,7 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
13411341 return [ ] ;
13421342 }
13431343
1344- const reviewers : ( IAccount | ITeam ) [ ] = parseGraphQLReviewers ( data , githubRepository ) ;
1344+ const reviewers : ( IAccount | ITeam ) [ ] = await parseGraphQLReviewers ( data , githubRepository ) ;
13451345 if ( this . reviewers ?. length !== reviewers . length || ( this . reviewers . some ( r => ! reviewers . some ( rr => rr . id === r . id ) ) ) ) {
13461346 this . reviewers = reviewers ;
13471347 this . _onDidChange . fire ( { reviewers : true } ) ;
@@ -1452,8 +1452,8 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
14521452 } ) ;
14531453 }
14541454
1455- private setReviewThreadCacheFromRaw ( raw : ReviewThread [ ] ) : IReviewThread [ ] {
1456- const reviewThreads : IReviewThread [ ] = raw . map ( thread => parseGraphQLReviewThread ( thread , this . githubRepository ) ) ;
1455+ private async setReviewThreadCacheFromRaw ( raw : ReviewThread [ ] ) : Promise < IReviewThread [ ] > {
1456+ const reviewThreads : IReviewThread [ ] = await Promise . all ( raw . map ( thread => parseGraphQLReviewThread ( thread , this . githubRepository ) ) ) ;
14571457 const oldReviewThreads = this . _reviewThreadsCache ?? [ ] ;
14581458 this . _reviewThreadsCache = reviewThreads ;
14591459 this . diffThreads ( oldReviewThreads , reviewThreads ) ;
@@ -1556,7 +1556,7 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
15561556 per_page : 100
15571557 } ) ;
15581558 const workStartedInitiator = ( timeline . data . find ( event => event . event === 'copilot_work_started' ) as { actor : RestAccount } | undefined ) ?. actor ;
1559- return workStartedInitiator ? [ parseAccount ( workStartedInitiator , this . githubRepository ) ] : [ ] ;
1559+ return workStartedInitiator ? [ await parseAccount ( workStartedInitiator , this . githubRepository ) ] : [ ] ;
15601560 }
15611561
15621562 protected override getUpdatesQuery ( schema : any ) : any {
@@ -2105,7 +2105,7 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
21052105
21062106 const index = this . _reviewThreadsCache ?. findIndex ( thread => thread . id === threadId ) ?? - 1 ;
21072107 if ( index > - 1 ) {
2108- const thread = parseGraphQLReviewThread ( data . resolveReviewThread . thread , this . githubRepository ) ;
2108+ const thread = await parseGraphQLReviewThread ( data . resolveReviewThread . thread , this . githubRepository ) ;
21092109 this . _reviewThreadsCache ?. splice ( index , 1 , thread ) ;
21102110 this . _onDidChangeReviewThreads . fire ( { added : [ ] , changed : [ thread ] , removed : [ ] } ) ;
21112111 }
@@ -2148,7 +2148,7 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
21482148
21492149 const index = this . _reviewThreadsCache ?. findIndex ( thread => thread . id === threadId ) ?? - 1 ;
21502150 if ( index > - 1 ) {
2151- const thread = parseGraphQLReviewThread ( data . unresolveReviewThread . thread , this . githubRepository ) ;
2151+ const thread = await parseGraphQLReviewThread ( data . unresolveReviewThread . thread , this . githubRepository ) ;
21522152 this . _reviewThreadsCache ?. splice ( index , 1 , thread ) ;
21532153 this . _onDidChangeReviewThreads . fire ( { added : [ ] , changed : [ thread ] , removed : [ ] } ) ;
21542154 }
0 commit comments