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);