From 08b96424080a7f739dad0cdfdf6e0f5c9eb0f7e4 Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Tue, 17 Feb 2026 11:22:13 -0800 Subject: [PATCH] =?UTF-8?q?fix(telemetry):=203=20bugs=20=E2=80=94=20Slack?= =?UTF-8?q?=20Block=20Kit=20text=20key,=20cluster=20reopen=20clears=20reso?= =?UTF-8?q?lution,=20affectedInstallIds=20uses=20correct=20ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/telemetry/routes.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/services/platform-service/src/modules/telemetry/routes.ts b/services/platform-service/src/modules/telemetry/routes.ts index bce67fb3..ae5f42c0 100644 --- a/services/platform-service/src/modules/telemetry/routes.ts +++ b/services/platform-service/src/modules/telemetry/routes.ts @@ -116,7 +116,7 @@ async function sendClusterAlert( type: 'section', text: { type: 'mrkdwn', - value: [ + text: [ `*Telemetry Error Cluster Escalated*`, `*Event:* ${cluster.module}/${cluster.eventName}`, `*Platform:* ${cluster.platform} (${cluster.channel})`, @@ -424,8 +424,12 @@ async function updateClusterForEvent(event: TelemetryEventDoc): Promise { if (uid && event.userId && !existing.affectedUserIds.includes(uid)) { if (existing.affectedUserIds.length < 100) existing.affectedUserIds.push(uid); } - if (uid && event.anonymousInstallId && !existing.affectedInstallIds.includes(uid)) { - if (existing.affectedInstallIds.length < 100) existing.affectedInstallIds.push(uid); + if ( + event.anonymousInstallId && + !existing.affectedInstallIds.includes(event.anonymousInstallId) + ) { + if (existing.affectedInstallIds.length < 100) + existing.affectedInstallIds.push(event.anonymousInstallId); } if (!existing.affectedOsFamilies.includes(event.osFamily)) { existing.affectedOsFamilies.push(event.osFamily); @@ -861,6 +865,10 @@ export async function telemetryRoutes(app: FastifyInstance) { if (parsed.data.status === 'resolved' || parsed.data.status === 'ignored') { updates.resolvedBy = req.jwtPayload?.sub ?? 'unknown'; updates.resolvedAt = new Date().toISOString(); + } else if (parsed.data.status === 'open') { + // Clear resolution metadata when reopening + updates.resolvedBy = undefined; + updates.resolvedAt = undefined; } const updated = await repo.updateCluster(id, pk, updates);