@@ -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,
@@ -2098,6 +2104,7 @@ export interface GitHubReviewThreadComments {
20982104 readonly reactions : ReadonlyArray < PullRequestReaction > ;
20992105 /** Reactions by node id, for the comments and reviews the `gh` JSON read carries no reaction on. */
21002106 readonly reactionsById : ReadonlyMap < string , ReadonlyArray < PullRequestReaction > > ;
2107+ readonly editedAtById : ReadonlyMap < string , string > ;
21012108 /**
21022109 * Everyone on the review: those still asked and those who have already answered. Whoever has
21032110 * reviewed is no longer an outstanding request, so asking only for requests reports nobody on
@@ -2147,6 +2154,7 @@ export interface GitHubReviewThreadPage {
21472154 * for without any. Only ids with a reaction are here; the rest carry none.
21482155 */
21492156 readonly reactionsById : ReadonlyMap < string , ReadonlyArray < PullRequestReaction > > ;
2157+ readonly editedAtById : ReadonlyMap < string , string > ;
21502158 readonly reviewers : ReadonlyArray < PullRequestActor > ;
21512159 readonly avatarsByLogin : ReadonlyMap < string , string > ;
21522160 readonly botLogins : ReadonlySet < string > ;
@@ -2177,6 +2185,7 @@ export function reviewThreadConversation(
21772185 author : comment . author ,
21782186 body : comment . body ,
21792187 createdAt : comment . createdAt ,
2188+ editedAt : comment . editedAt ?? null ,
21802189 url : comment . url ,
21812190 path : thread . path ,
21822191 reviewState : null ,
@@ -2276,6 +2285,7 @@ export function decodeReviewThreadsJson(
22762285 author : toActor ( comment . author ) ,
22772286 body : comment . body ?? "" ,
22782287 createdAt : comment . createdAt ,
2288+ editedAt : comment . lastEditedAt ?? null ,
22792289 url : trimmed ( comment . url ) ,
22802290 reactions : toReactions ( comment . reactionGroups , viewer ) ,
22812291 } ) ) ,
@@ -2342,12 +2352,15 @@ export function decodeReviewThreadsJson(
23422352 } ) ;
23432353 }
23442354 const reactionsById = new Map < string , ReadonlyArray < PullRequestReaction > > ( ) ;
2355+ const editedAtById = new Map < string , string > ( ) ;
23452356 for ( const node of [
23462357 ...( pullRequest . comments ?. nodes ?? [ ] ) ,
23472358 ...( pullRequest . reviews ?. nodes ?? [ ] ) ,
23482359 ] ) {
23492360 const id = trimmed ( node . id ) ;
23502361 if ( id === null ) continue ;
2362+ const editedAt = trimmed ( node . lastEditedAt ) ;
2363+ if ( editedAt !== null ) editedAtById . set ( id , editedAt ) ;
23512364 const reactions = toReactions ( node . reactionGroups , viewer ) ;
23522365 if ( reactions . length > 0 ) reactionsById . set ( id , reactions ) ;
23532366 }
@@ -2356,6 +2369,7 @@ export function decodeReviewThreadsJson(
23562369 nextCursor : nextCursorOf ( threads . pageInfo ) ,
23572370 reactions : toReactions ( pullRequest . reactionGroups , viewer ) ,
23582371 reactionsById,
2372+ editedAtById,
23592373 reviewers : [ ...reviewers . values ( ) ] ,
23602374 avatarsByLogin,
23612375 botLogins,
@@ -2392,6 +2406,7 @@ export function decodeReviewThreadCommentsJson(raw: string): Result.Result<
23922406 author : toActor ( comment . author ) ,
23932407 body : comment . body ?? "" ,
23942408 createdAt : comment . createdAt ,
2409+ editedAt : comment . lastEditedAt ?? null ,
23952410 url : trimmed ( comment . url ) ,
23962411 reactions : toReactions ( comment . reactionGroups , viewer ) ,
23972412 } ) ) ,
0 commit comments