@@ -341,42 +341,52 @@ export const make = Effect.gen(function* () {
341341 editedAtByNoteId : new Map < string , string > ( ) ,
342342 botLogins : new Set < string > ( ) ,
343343 } ) ,
344+ // Usually cached by the detail read beside this one; web_url holds the real web origin.
345+ recoverRead (
346+ mergeRequestDetail ( input ) . pipe ( Effect . map ( ( mergeRequest ) => mergeRequest . url ) ) ,
347+ null ,
348+ ) ,
344349 ] ,
345- { concurrency : 4 } ,
350+ { concurrency : 5 } ,
346351 ) . pipe (
347352 Effect . mapError ( fail ( "getChangeRequestActivity" ) ) ,
348- Effect . map ( ( [ notes , commits , discussions , awards ] ) : ProviderChangeRequestActivity => {
349- const edited = ( id : string ) => {
350- const editedAt = awards . editedAtByNoteId . get ( id ) ;
351- return editedAt === undefined ? { } : { editedAt } ;
352- } ;
353- const botLogins = new Set ( [ ...awards . botLogins ] . map ( ( login ) => login . toLowerCase ( ) ) ) ;
354- const withBotFlag = ( author : PullRequestActor | null ) =>
355- author !== null && botLogins . has ( author . login . toLowerCase ( ) )
356- ? { ...author , isBot : true }
357- : author ;
358- return {
359- reactions : awards . reactions ,
360- comments : notes . comments . map ( ( comment ) => ( {
361- ...comment ,
362- ...edited ( comment . id ) ,
363- author : withBotFlag ( comment . author ) ,
364- reactions : awards . reactionsByNoteId . get ( comment . id ) ?? [ ] ,
365- } ) ) ,
366- commentCount : notes . comments . length ,
367- commentsTruncated : notes . truncated || discussions . truncated ,
368- reviewThreads : discussions . threads . map ( ( thread ) => ( {
369- ...thread ,
370- comments : thread . comments . map ( ( comment ) => ( {
353+ Effect . map (
354+ ( [ notes , commits , discussions , awards , webUrl ] ) : ProviderChangeRequestActivity => {
355+ const noteUrl = ( id : string ) => ( webUrl === null ? null : `${ webUrl } #note_${ id } ` ) ;
356+ const edited = ( id : string ) => {
357+ const editedAt = awards . editedAtByNoteId . get ( id ) ;
358+ return editedAt === undefined ? { } : { editedAt } ;
359+ } ;
360+ const botLogins = new Set ( [ ...awards . botLogins ] . map ( ( login ) => login . toLowerCase ( ) ) ) ;
361+ const withBotFlag = ( author : PullRequestActor | null ) =>
362+ author !== null && botLogins . has ( author . login . toLowerCase ( ) )
363+ ? { ...author , isBot : true }
364+ : author ;
365+ return {
366+ reactions : awards . reactions ,
367+ comments : notes . comments . map ( ( comment ) => ( {
371368 ...comment ,
372369 ...edited ( comment . id ) ,
373370 author : withBotFlag ( comment . author ) ,
371+ url : noteUrl ( comment . id ) ,
374372 reactions : awards . reactionsByNoteId . get ( comment . id ) ?? [ ] ,
375373 } ) ) ,
376- } ) ) ,
377- commits,
378- } ;
379- } ) ,
374+ commentCount : notes . comments . length ,
375+ commentsTruncated : notes . truncated || discussions . truncated ,
376+ reviewThreads : discussions . threads . map ( ( thread ) => ( {
377+ ...thread ,
378+ comments : thread . comments . map ( ( comment ) => ( {
379+ ...comment ,
380+ ...edited ( comment . id ) ,
381+ author : withBotFlag ( comment . author ) ,
382+ url : noteUrl ( comment . id ) ,
383+ reactions : awards . reactionsByNoteId . get ( comment . id ) ?? [ ] ,
384+ } ) ) ,
385+ } ) ) ,
386+ commits,
387+ } ;
388+ } ,
389+ ) ,
380390 ) ,
381391
382392 // Straight from the host, never the shared read: this is what a write is refused or let
0 commit comments