@@ -927,15 +927,15 @@ export const make = Effect.gen(function* () {
927927 ) ;
928928
929929 /**
930- * The checks of finished pipelines, by pipeline and the moment it settled, or null where its
931- * jobs could not stand for it. A finished pipeline's jobs do not change until it runs again,
932- * and that moves the moment, so every refresh of a merge request whose pipeline is done costs
933- * no job reads. Only answers GitLab gave are kept: a read that failed is tried again. A
930+ * The checks of finished pipelines, by pipeline and the moment it settled. A finished
931+ * pipeline's jobs do not change until it runs again, and that moves the moment, so every
932+ * refresh of a merge request whose pipeline is done costs no job reads. Only whole job lists
933+ * are kept: a read that failed, came back partial or found no jobs is tried again. A
934934 * pipeline with trigger jobs is never kept: the pipelines they start run on their own, past
935935 * the parent finishing and through retries that never move the parent's moment.
936936 */
937- const settledPipelineChecks = new Map < string , ReadonlyArray < PullRequestCheck > | null > ( ) ;
938- const rememberSettledPipeline = ( key : string , checks : ReadonlyArray < PullRequestCheck > | null ) => {
937+ const settledPipelineChecks = new Map < string , ReadonlyArray < PullRequestCheck > > ( ) ;
938+ const rememberSettledPipeline = ( key : string , checks : ReadonlyArray < PullRequestCheck > ) => {
939939 settledPipelineChecks . set ( key , checks ) ;
940940 if ( settledPipelineChecks . size > SETTLED_PIPELINE_CAPACITY ) {
941941 // Maps iterate in insertion order, so the first key is the oldest.
@@ -997,7 +997,7 @@ export const make = Effect.gen(function* () {
997997 : `${ pipeline . projectId } /${ pipeline . id } @${ pipeline . settledAt } ` ;
998998 const settled = settledKey === null ? undefined : settledPipelineChecks . get ( settledKey ) ;
999999 if ( settled !== undefined ) {
1000- return Effect . succeed ( settled === null ? detail : { ...detail , checks : settled } ) ;
1000+ return Effect . succeed ( { ...detail , checks : settled } ) ;
10011001 }
10021002 const list = ( kind : "jobs" | "bridges" ) =>
10031003 pipelineJobsPage ( {
@@ -1015,7 +1015,7 @@ export const make = Effect.gen(function* () {
10151015 [ ...jobs , ...bridges ]
10161016 . toSorted ( ( left , right ) => left . id - right . id )
10171017 . map ( ( job ) => job . check ) ;
1018- if ( settledKey !== null && bridges ?. length === 0 ) {
1018+ if ( settledKey !== null && checks !== null && bridges ?. length === 0 ) {
10191019 rememberSettledPipeline ( settledKey , checks ) ;
10201020 }
10211021 return checks === null ? detail : { ...detail , checks } ;
0 commit comments