From 4329820778f19e75545e50d2f775fce04351e5e0 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 29 Aug 2024 08:33:31 +0000 Subject: [PATCH] fix(analytics): check do not track (#4329) Our do not track check was wrong and always returning true. This is why we were getting nothing. (cherry picked from commit e04d0f6924154018999a1adf829565e4560c669c) --- ignite/internal/analytics/analytics.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ignite/internal/analytics/analytics.go b/ignite/internal/analytics/analytics.go index b31403bb4f..4b5936e26d 100644 --- a/ignite/internal/analytics/analytics.go +++ b/ignite/internal/analytics/analytics.go @@ -102,8 +102,10 @@ func SendMetric(wg *sync.WaitGroup, cmd *cobra.Command) { // checkDNT check if the user allow to track data or if the DO_NOT_TRACK // env var is set https://consoledonottrack.com/ func checkDNT() (anonIdentity, error) { - if dnt, err := strconv.ParseBool(os.Getenv(envDoNotTrack)); err != nil || dnt { - return anonIdentity{DoNotTrack: true}, nil + if dnt := os.Getenv(envDoNotTrack); dnt != "" { + if dnt, err := strconv.ParseBool(dnt); err != nil || dnt { + return anonIdentity{DoNotTrack: true}, nil + } } globalPath, err := config.DirPath()