From b9a3452a4b3fad7d815dfb30f835d9703481b098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20=C3=96sterberg?= Date: Thu, 14 May 2026 22:49:20 +0200 Subject: [PATCH] Fix double-wrapped no-network issue in createKnowledgeFromData When the target page cannot be loaded (e.g. browsertime UrlLoadError), createKnowledgeFromData wrapped the no-network issue in an extra 'no-network' key, producing knowledgeData.issues of the shape: { 'no-network': { 'no-network': { rule, severity, subIssues, ... } } } instead of the expected: { 'no-network': { rule, severity, subIssues, ... } } This caused downstream consumers (plugin-webperf-core's pug template and webperf_core's calculate_rating) to fail because severity and subIssues were one level too deep. Aligns the shape with plugin-accessibility-statement and the rest of the no-network handling in this file. Fixes #142 --- lib/harAnalyzer.js | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/harAnalyzer.js b/lib/harAnalyzer.js index 02cbebb..a43495e 100644 --- a/lib/harAnalyzer.js +++ b/lib/harAnalyzer.js @@ -267,23 +267,21 @@ export class HarAnalyzer { if (!('page' in analyzedData) || !analyzedData['page']) { knowledgeData['issues']['no-network'] = { - 'no-network': { - 'test': '404', - 'rule': 'no-network', - 'category': 'technical', - 'severity': 'warning', - 'subIssues': [ - { - 'url': url, - 'rule': 'no-network', - 'category': 'standard', - 'severity': 'warning', - 'text': `No HTML content found in the HAR file.`, - 'line': 0, - 'column': 0 - } - ] - } + 'test': '404', + 'rule': 'no-network', + 'category': 'technical', + 'severity': 'warning', + 'subIssues': [ + { + 'url': url, + 'rule': 'no-network', + 'category': 'standard', + 'severity': 'warning', + 'text': `No HTML content found in the HAR file.`, + 'line': 0, + 'column': 0 + } + ] }; return knowledgeData; }