diff --git a/src/plugins/telemetry/server/routes/index.ts b/src/plugins/telemetry/server/routes/index.ts index 8b73c8d76c4e..5a47b4a00ac1 100644 --- a/src/plugins/telemetry/server/routes/index.ts +++ b/src/plugins/telemetry/server/routes/index.ts @@ -35,6 +35,6 @@ export function registerRoutes(options: RegisterRoutesParams) { registerTelemetryConfigRoutes(options); registerTelemetryUsageStatsRoutes(router, telemetryCollectionManager, isDev, getSecurity); registerTelemetryOptInStatsRoutes(router, telemetryCollectionManager); - registerTelemetryUserHasSeenNotice(router); + registerTelemetryUserHasSeenNotice(router, options.currentKibanaVersion); registerTelemetryLastReported(router, savedObjectsInternalClient$); } diff --git a/src/plugins/telemetry/server/routes/telemetry_user_has_seen_notice.ts b/src/plugins/telemetry/server/routes/telemetry_user_has_seen_notice.ts index eeac24c0f5a0..d9cb0b981b0a 100644 --- a/src/plugins/telemetry/server/routes/telemetry_user_has_seen_notice.ts +++ b/src/plugins/telemetry/server/routes/telemetry_user_has_seen_notice.ts @@ -15,7 +15,7 @@ import { updateTelemetrySavedObject, } from '../saved_objects'; -export function registerTelemetryUserHasSeenNotice(router: IRouter) { +export function registerTelemetryUserHasSeenNotice(router: IRouter, currentKibanaVersion: string) { router.put( { path: '/api/telemetry/v2/userHasSeenNotice', @@ -31,6 +31,9 @@ export function registerTelemetryUserHasSeenNotice(router: IRouter) { const updatedAttributes: TelemetrySavedObjectAttributes = { ...telemetrySavedObject, userHasSeenNotice: true, + // We need to store that the user was notified in this version. + // Otherwise, it'll continuously show the banner if previously opted-out. + lastVersionChecked: currentKibanaVersion, }; await updateTelemetrySavedObject(soClient, updatedAttributes);