@@ -96,10 +96,7 @@ function finalize(partialModel: PartialInsightModel<LCPDiscoveryInsightModel>):
9696export function generateInsight (
9797 parsedTrace : Handlers . Types . ParsedTrace , context : InsightSetContext ) : LCPDiscoveryInsightModel {
9898 if ( ! context . navigation ) {
99- return finalize ( {
100-
101- frameId : context . frameId ,
102- } ) ;
99+ return finalize ( { } ) ;
103100 }
104101
105102 const networkRequests = parsedTrace . NetworkRequests ;
@@ -116,17 +113,17 @@ export function generateInsight(
116113 const metricScore = navMetrics . get ( Handlers . ModelHandlers . PageLoadMetrics . MetricName . LCP ) ;
117114 const lcpEvent = metricScore ?. event ;
118115 if ( ! lcpEvent || ! Types . Events . isLargestContentfulPaintCandidate ( lcpEvent ) ) {
119- return finalize ( { frameId : context . frameId , warnings : [ InsightWarning . NO_LCP ] } ) ;
116+ return finalize ( { warnings : [ InsightWarning . NO_LCP ] } ) ;
120117 }
121118
122119 const docRequest = networkRequests . byTime . find ( req => req . args . data . requestId === context . navigationId ) ;
123120 if ( ! docRequest ) {
124- return finalize ( { frameId : context . frameId , lcpEvent , warnings : [ InsightWarning . NO_DOCUMENT_REQUEST ] } ) ;
121+ return finalize ( { warnings : [ InsightWarning . NO_DOCUMENT_REQUEST ] } ) ;
125122 }
126123
127124 const lcpRequest = parsedTrace . LargestImagePaint . lcpRequestByNavigation . get ( context . navigation ) ;
128125 if ( ! lcpRequest ) {
129- return finalize ( { frameId : context . frameId , lcpEvent} ) ;
126+ return finalize ( { lcpEvent} ) ;
130127 }
131128
132129 const initiatorUrl = lcpRequest . args . data . initiator ?. url ;
@@ -147,7 +144,6 @@ export function generateInsight(
147144 const priorityHintFound = imageFetchPriorityHint === 'high' ;
148145
149146 return finalize ( {
150- frameId : context . frameId ,
151147 lcpEvent,
152148 lcpRequest,
153149 earliestDiscoveryTimeTs : earliestDiscoveryTime ? Types . Timing . Micro ( earliestDiscoveryTime ) : undefined ,
0 commit comments