From e8c61e476b9f6c7122995753ff9524efc9970d35 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Dec 2025 18:02:07 +0000 Subject: [PATCH 1/3] Initial plan From 2c4db2e8bc3ca772b67992d43cdb9cb3232c6d4b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Dec 2025 18:05:05 +0000 Subject: [PATCH 2/3] Extract magic number 500 to TREE_VIEW_REFRESH_DEBOUNCE_MS constant Co-authored-by: angelo-hub <12058178+angelo-hub@users.noreply.github.com> --- src/activation/treeView.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/activation/treeView.ts b/src/activation/treeView.ts index d3eff88..7b62a5e 100644 --- a/src/activation/treeView.ts +++ b/src/activation/treeView.ts @@ -3,6 +3,11 @@ import { UniversalTicketsProvider } from "@shared/views/UniversalTicketsProvider import { getLogger } from "@shared/utils/logger"; import { debounce } from "@shared/utils/debounce"; +/** + * Debounce delay for tree view refresh on visibility changes (in milliseconds) + */ +const TREE_VIEW_REFRESH_DEBOUNCE_MS = 500; + /** * Register the tickets tree view (sidebar) */ @@ -30,7 +35,7 @@ export async function registerTreeView(context: vscode.ExtensionContext): Promis ticketsProvider?.refresh(); hasInitialData = true; } - }, 500); + }, TREE_VIEW_REFRESH_DEBOUNCE_MS); // Trigger refresh when the tree view becomes visible (debounced) treeView.onDidChangeVisibility((e) => { From 9faaf68d4a52a0166b66e71dfbc70b4c938aeeb9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Dec 2025 18:08:31 +0000 Subject: [PATCH 3/3] Extract magic number 30000 to MIN_RATE_LIMIT_DELAY_MS constant Co-authored-by: angelo-hub <12058178+angelo-hub@users.noreply.github.com> --- src/shared/http/RetryableHttpClient.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/shared/http/RetryableHttpClient.ts b/src/shared/http/RetryableHttpClient.ts index 5afa283..2df1fe0 100644 --- a/src/shared/http/RetryableHttpClient.ts +++ b/src/shared/http/RetryableHttpClient.ts @@ -70,6 +70,12 @@ export class HttpError extends Error { } } +/** + * Minimum delay in milliseconds for rate limit retries when no Retry-After header is present. + * This ensures we wait long enough to avoid immediately hitting the rate limit again. + */ +const MIN_RATE_LIMIT_DELAY_MS = 30000; // 30 seconds + /** * Default retry configuration */ @@ -325,8 +331,8 @@ export class RetryableHttpClient { if (retryAfter !== null) { delay = Math.min(retryAfter, retryConfig.maxDelay); } else { - // Default delay for rate limiting without Retry-After - delay = Math.max(delay, 30000); // At least 30 seconds + // When no Retry-After header, use minimum delay to avoid immediately re-triggering rate limit + delay = Math.max(delay, MIN_RATE_LIMIT_DELAY_MS); } }