diff --git a/server/channels/api4/license.go b/server/channels/api4/license.go index 9911c241e1..02420a824d 100644 --- a/server/channels/api4/license.go +++ b/server/channels/api4/license.go @@ -354,15 +354,18 @@ func requestTrueUpReview(c *Context, w http.ResponseWriter, r *http.Request) { // Do not send true-up review data if the user has already requested one for the quarter. // And only send a true-up review via as a one-time telemetry request if telemetry is disabled. telemetryEnabled := c.App.Config().LogSettings.EnableDiagnostics - if telemetryEnabled != nil && !*telemetryEnabled { + if telemetryEnabled != nil && *telemetryEnabled { // Send telemetry data c.App.Srv().GetTelemetryService().SendTelemetry(model.TrueUpReviewTelemetryName, profileMap) - - // Update the review status to reflect the completion. - status.Completed = true - c.App.Srv().Store().TrueUpReview().Update(status) + } else { + // Telemetry is disabled, submit true up review profile via CWS. + c.App.Cloud().SubmitTrueUpReview(profileMap) } + // Update the review status to reflect the completion. + status.Completed = true + c.App.Srv().Store().TrueUpReview().Update(status) + // Encode to string rather than byte[] otherwise json.Marshal will encode it further. encodedData := b64.StdEncoding.EncodeToString(profileMapJson) responseContent := struct { diff --git a/server/channels/einterfaces/cloud.go b/server/channels/einterfaces/cloud.go index 70cdc4676a..1dd2ea65ac 100644 --- a/server/channels/einterfaces/cloud.go +++ b/server/channels/einterfaces/cloud.go @@ -48,4 +48,7 @@ type CloudInterface interface { SelfServeDeleteWorkspace(userID string, deletionRequest *model.WorkspaceDeletionRequest) error SubscribeToNewsletter(userID string, req *model.SubscribeNewsletterRequest) error + + // Used only for when a customer has telemetry disabled. In this scenario, true up review telemetry will be submitted via CWS. + SubmitTrueUpReview(trueUpReviewProfile map[string]any) error } diff --git a/webapp/channels/src/components/analytics/true_up_review.tsx b/webapp/channels/src/components/analytics/true_up_review.tsx index 5098999d63..c5ce7b38b2 100644 --- a/webapp/channels/src/components/analytics/true_up_review.tsx +++ b/webapp/channels/src/components/analytics/true_up_review.tsx @@ -223,10 +223,6 @@ const TrueUpReview: React.FC = () => { return null; } - if (telemetryEnabled) { - return null; - } - pageVisited(TELEMETRY_CATEGORIES.TRUE_UP_REVIEW, 'pageview_true_up_review'); return (