Răsfoiți Sursa

prevent against breaking changes for notification (#3987)

Feroze Mohideen 2 ani în urmă
părinte
comite
266641632c
1 a modificat fișierele cu 5 adăugiri și 0 ștergeri
  1. 5 0
      api/server/handlers/porter_app/current_app_revision.go

+ 5 - 0
api/server/handlers/porter_app/current_app_revision.go

@@ -169,6 +169,11 @@ func (c *LatestAppRevisionHandler) ServeHTTP(w http.ResponseWriter, r *http.Requ
 			telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "notification-conversion-error", Value: "notification is nil"})
 			continue
 		}
+		// TODO: remove this check once this attribute is not found in the span for >30 days
+		if notification.Scope == "" {
+			telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "notification-conversion-error", Value: "old-notification-format"})
+			continue
+		}
 		latestNotifications = append(latestNotifications, *notification)
 	}