From ffd184cb6e383b0febc95c62316e8240f8280dbf Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Tue, 14 May 2024 19:54:13 +0545 Subject: [PATCH] fix: do not update parent & path if graph cannot be formed --- db/update.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/update.go b/db/update.go index 54a626aa..d0c8ef7b 100644 --- a/db/update.go +++ b/db/update.go @@ -627,6 +627,12 @@ func extractConfigsAndChangesFromResults(ctx api.ScrapeContext, scrapeStartTime if existing == nil || existing.ID == "" { newConfigs = append(newConfigs, ci) } else { + // In case, we are not able to derive the path & parent_id + // by forming a tree, we need to use the existing one + // otherwise they'll be updated to empty values + ci.ParentID = existing.ParentID + ci.Path = existing.Path + configsToUpdate = append(configsToUpdate, &updateConfigArgs{ Result: result, Existing: existing,