@@ -362,6 +362,7 @@ function toReactions(
362362
363363const RawCommentSchema = Schema . Struct ( {
364364 id : Schema . String ,
365+ lastEditedAt : Schema . optional ( Schema . NullOr ( Schema . String ) ) ,
365366 author : Schema . optional ( Schema . NullOr ( RawActorSchema ) ) ,
366367 body : Schema . optional ( Schema . String ) ,
367368 createdAt : Schema . String ,
@@ -372,6 +373,7 @@ const RawCommentSchema = Schema.Struct({
372373
373374const RawReviewSchema = Schema . Struct ( {
374375 id : Schema . String ,
376+ lastEditedAt : Schema . optional ( Schema . NullOr ( Schema . String ) ) ,
375377 author : Schema . optional ( Schema . NullOr ( RawActorSchema ) ) ,
376378 body : Schema . optional ( Schema . String ) ,
377379 state : Schema . optional ( Schema . NullOr ( Schema . String ) ) ,
@@ -490,6 +492,7 @@ const RawReviewThreadsSchema = Schema.Struct({
490492 Schema . Struct ( {
491493 id : Schema . optional ( Schema . NullOr ( Schema . String ) ) ,
492494 author : Schema . optional ( Schema . NullOr ( RawActorSchema ) ) ,
495+ lastEditedAt : Schema . optional ( Schema . NullOr ( Schema . String ) ) ,
493496 reactionGroups : RawReactionGroupsSchema ,
494497 } ) ,
495498 ) ,
@@ -507,6 +510,7 @@ const RawReviewThreadsSchema = Schema.Struct({
507510 Schema . Struct ( {
508511 id : Schema . optional ( Schema . NullOr ( Schema . String ) ) ,
509512 author : Schema . optional ( Schema . NullOr ( RawActorSchema ) ) ,
513+ lastEditedAt : Schema . optional ( Schema . NullOr ( Schema . String ) ) ,
510514 reactionGroups : RawReactionGroupsSchema ,
511515 } ) ,
512516 ) ,
@@ -885,7 +889,7 @@ export const REVIEW_THREADS_GRAPHQL_QUERY = `query($owner: String!, $name: Strin
885889 comments(first: 10) {
886890 totalCount
887891 pageInfo { hasNextPage endCursor }
888- nodes { id author { __typename login avatarUrl } body createdAt url ${ REACTION_GROUPS_FIELDS } }
892+ nodes { id author { __typename login avatarUrl } body createdAt lastEditedAt url ${ REACTION_GROUPS_FIELDS } }
889893 }
890894 }
891895 }
@@ -894,9 +898,9 @@ export const REVIEW_THREADS_GRAPHQL_QUERY = `query($owner: String!, $name: Strin
894898 author { __typename login avatarUrl }
895899 ${ REACTION_GROUPS_FIELDS }
896900 comments(first: ${ GRAPHQL_PAGE_SIZE } ) {
897- nodes { id author { __typename login avatarUrl } ${ REACTION_GROUPS_FIELDS } }
901+ nodes { id lastEditedAt author { __typename login avatarUrl } ${ REACTION_GROUPS_FIELDS } }
898902 }
899- reviews(first: ${ GRAPHQL_PAGE_SIZE } ) { nodes { id author { __typename login avatarUrl } ${ REACTION_GROUPS_FIELDS } } }
903+ reviews(first: ${ GRAPHQL_PAGE_SIZE } ) { nodes { id lastEditedAt author { __typename login avatarUrl } ${ REACTION_GROUPS_FIELDS } } }
900904 reviewRequests(first: 50) {
901905 nodes {
902906 requestedReviewer {
@@ -942,7 +946,7 @@ export const REVIEW_THREAD_COMMENTS_GRAPHQL_QUERY = `query($owner: String!, $nam
942946 pullRequest { id }
943947 comments(first: ${ GRAPHQL_PAGE_SIZE } , after: $cursor) {
944948 pageInfo { hasNextPage endCursor }
945- nodes { id author { __typename login avatarUrl } body createdAt url ${ REACTION_GROUPS_FIELDS } }
949+ nodes { id author { __typename login avatarUrl } body createdAt lastEditedAt url ${ REACTION_GROUPS_FIELDS } }
946950 }
947951 }
948952 }
@@ -1542,6 +1546,7 @@ function toComments(raw: {
15421546 author : toActor ( comment . author ) ,
15431547 body : comment . body ?? "" ,
15441548 createdAt : comment . createdAt ,
1549+ editedAt : comment . lastEditedAt ?? null ,
15451550 url : trimmed ( comment . url ) ,
15461551 path : null ,
15471552 reviewState : null ,
@@ -1566,6 +1571,7 @@ function toComments(raw: {
15661571 author : toActor ( review . author ) ,
15671572 body : review . body ?? "" ,
15681573 createdAt : submittedAt ,
1574+ editedAt : review . lastEditedAt ?? null ,
15691575 url : trimmed ( review . url ) ,
15701576 path : null ,
15711577 reviewState,
@@ -2097,6 +2103,7 @@ export interface GitHubReviewThreadComments {
20972103 readonly reactions : ReadonlyArray < PullRequestReaction > ;
20982104 /** Reactions by node id, for the comments and reviews the `gh` JSON read carries no reaction on. */
20992105 readonly reactionsById : ReadonlyMap < string , ReadonlyArray < PullRequestReaction > > ;
2106+ readonly editedAtById : ReadonlyMap < string , string > ;
21002107 /**
21012108 * Everyone on the review: those still asked and those who have already answered. Whoever has
21022109 * reviewed is no longer an outstanding request, so asking only for requests reports nobody on
@@ -2146,6 +2153,7 @@ export interface GitHubReviewThreadPage {
21462153 * for without any. Only ids with a reaction are here; the rest carry none.
21472154 */
21482155 readonly reactionsById : ReadonlyMap < string , ReadonlyArray < PullRequestReaction > > ;
2156+ readonly editedAtById : ReadonlyMap < string , string > ;
21492157 readonly reviewers : ReadonlyArray < PullRequestActor > ;
21502158 readonly avatarsByLogin : ReadonlyMap < string , string > ;
21512159 readonly botLogins : ReadonlySet < string > ;
@@ -2176,6 +2184,7 @@ export function reviewThreadConversation(
21762184 author : comment . author ,
21772185 body : comment . body ,
21782186 createdAt : comment . createdAt ,
2187+ editedAt : comment . editedAt ?? null ,
21792188 url : comment . url ,
21802189 path : thread . path ,
21812190 reviewState : null ,
@@ -2275,6 +2284,7 @@ export function decodeReviewThreadsJson(
22752284 author : toActor ( comment . author ) ,
22762285 body : comment . body ?? "" ,
22772286 createdAt : comment . createdAt ,
2287+ editedAt : comment . lastEditedAt ?? null ,
22782288 url : trimmed ( comment . url ) ,
22792289 reactions : toReactions ( comment . reactionGroups , viewer ) ,
22802290 } ) ) ,
@@ -2341,12 +2351,15 @@ export function decodeReviewThreadsJson(
23412351 } ) ;
23422352 }
23432353 const reactionsById = new Map < string , ReadonlyArray < PullRequestReaction > > ( ) ;
2354+ const editedAtById = new Map < string , string > ( ) ;
23442355 for ( const node of [
23452356 ...( pullRequest . comments ?. nodes ?? [ ] ) ,
23462357 ...( pullRequest . reviews ?. nodes ?? [ ] ) ,
23472358 ] ) {
23482359 const id = trimmed ( node . id ) ;
23492360 if ( id === null ) continue ;
2361+ const editedAt = trimmed ( node . lastEditedAt ) ;
2362+ if ( editedAt !== null ) editedAtById . set ( id , editedAt ) ;
23502363 const reactions = toReactions ( node . reactionGroups , viewer ) ;
23512364 if ( reactions . length > 0 ) reactionsById . set ( id , reactions ) ;
23522365 }
@@ -2355,6 +2368,7 @@ export function decodeReviewThreadsJson(
23552368 nextCursor : nextCursorOf ( threads . pageInfo ) ,
23562369 reactions : toReactions ( pullRequest . reactionGroups , viewer ) ,
23572370 reactionsById,
2371+ editedAtById,
23582372 reviewers : [ ...reviewers . values ( ) ] ,
23592373 avatarsByLogin,
23602374 botLogins,
@@ -2391,6 +2405,7 @@ export function decodeReviewThreadCommentsJson(raw: string): Result.Result<
23912405 author : toActor ( comment . author ) ,
23922406 body : comment . body ?? "" ,
23932407 createdAt : comment . createdAt ,
2408+ editedAt : comment . lastEditedAt ?? null ,
23942409 url : trimmed ( comment . url ) ,
23952410 reactions : toReactions ( comment . reactionGroups , viewer ) ,
23962411 } ) ) ,
0 commit comments