From b1806e2d376d3f2ae3370329061c3cc271889964 Mon Sep 17 00:00:00 2001 From: hannesrudolph Date: Tue, 5 Aug 2025 10:23:55 -0700 Subject: [PATCH] fix: make TelemetryClient throw errors on auth failures to enable proper queue retry - TelemetryClient now throws errors when authentication fails or session token is missing - This allows the queue processor to properly identify failed sends and retry them later - Fixes issue where telemetry events were being discarded when in inactive-session state - Events will now be queued and retried when authentication is restored --- packages/cloud/src/TelemetryClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cloud/src/TelemetryClient.ts b/packages/cloud/src/TelemetryClient.ts index e33843a30c..8cb65cf3b9 100644 --- a/packages/cloud/src/TelemetryClient.ts +++ b/packages/cloud/src/TelemetryClient.ts @@ -27,14 +27,14 @@ export class TelemetryClient extends BaseTelemetryClient { private async fetch(path: string, options: RequestInit) { if (!this.authService.isAuthenticated()) { - return + throw new Error("Not authenticated") } const token = this.authService.getSessionToken() if (!token) { console.error(`[TelemetryClient#fetch] Unauthorized: No session token available.`) - return + throw new Error("No session token available") } const response = await fetch(`${getRooCodeApiUrl()}/api/${path}`, {