From f8956f30c162f28c4b97af2eea9dfacfd63cebd4 Mon Sep 17 00:00:00 2001 From: ktx-vaidehi <134508096+ktx-vaidehi@users.noreply.github.com> Date: Thu, 21 Aug 2025 19:39:21 +0530 Subject: [PATCH] fix: dashboard stream fields not found (#8087) ### **PR Type** Bug fix ___ ### **Description** Handle missing or empty stream schemas Fetch schema when absent or zero-length Default to empty schema to avoid errors Improve robustness of dashboard field loading ___ ### Diagram Walkthrough ```mermaid flowchart LR UI["FieldList.vue"] Check["Check stream.schema present and non-empty"] Fetch["Fetch schema via loadStreamFields(name)"] Validate["Validate schema not null/empty"] Assign["Assign settings and schema"] DefaultEmpty["Set stream.schema = [] and return"] UI -- "iterate streams" --> Check Check -- "missing or empty" --> Fetch Fetch --> Validate Validate -- "valid schema" --> Assign Validate -- "invalid/empty" --> DefaultEmpty ```

File Walkthrough

Relevant files
Bug fix
FieldList.vue
Robust schema presence and fallback handling                         

web/src/components/dashboards/addPanel/FieldList.vue
  • Add check for empty stream.schema arrays
  • Fetch schema when missing or empty
  • Guard against undefined/empty fetched schema
  • Default stream.schema to [] on failure
+10/-2   
___ --- web/src/components/dashboards/addPanel/FieldList.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/src/components/dashboards/addPanel/FieldList.vue b/web/src/components/dashboards/addPanel/FieldList.vue index 59d89528dc..8cee319037 100644 --- a/web/src/components/dashboards/addPanel/FieldList.vue +++ b/web/src/components/dashboards/addPanel/FieldList.vue @@ -1106,10 +1106,18 @@ export default defineComponent({ ) { // check for schema exist in the object or not // if not pull the schema from server. - if (!stream.hasOwnProperty("schema")) { + // Also check if schema is an empty array + if ( + !stream.hasOwnProperty("schema") || + (Array.isArray(stream.schema) && stream.schema.length === 0) + ) { const streamData: any = await loadStreamFields(stream.name); const streamSchema: any = streamData.schema; - if (streamSchema == undefined) { + if ( + !streamSchema || + (Array.isArray(streamSchema) && streamSchema.length === 0) + ) { + stream.schema = []; return; } stream.settings = streamData.settings;