Skip to content

add date formatting utility - #256

Open
BRN-SLP wants to merge 1 commit into
mainfrom
feat/handle-zero-case-8375
Open

add date formatting utility#256
BRN-SLP wants to merge 1 commit into
mainfrom
feat/handle-zero-case-8375

Conversation

@BRN-SLP

@BRN-SLP BRN-SLP commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Auto-generated: add date formatting utility

Project: mercato

@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 1 day (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/born-slippys-projects?upgradeToPro=build-rate-limit

@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/born-slippys-projects?upgradeToPro=build-rate-limit

Comment thread guards_add_retry_logic.ts
let lastError: unknown;
for (let i = 0; i < opts.retries; i++) {
try {
return fn();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: fn() is not awaited, so async rejections are never caught and retried

fn returns a Promise<T>. Calling return fn() without await returns the pending promise immediately; if fn() rejects later, that rejection is not caught by the catch block (which only catches synchronous throws). As a result the retry loop never re-runs for failed async calls, defeating the purpose of withRetry. Await it so rejections are caught:

Suggested change
return fn();
return await fn();

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread guards_add_retry_logic.ts
for (let i = 0; i < opts.retries; i++) {
try {
return fn();
} catch (e) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: catch (e) is unreachable for the intended async errors

Because the rejected promise from fn() is not awaited (see line 10), this catch only fires on synchronous throws. Once line 10 is fixed with await, this becomes reachable. Combined with the missing await, the retry logic currently never executes for real failures.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread guards_add_retry_logic.ts
@@ -0,0 +1,16 @@
const DEFAULTS = {
timeout: 5000,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: timeout in DEFAULTS is never used

opts.timeout is never referenced anywhere in the function, so the timeout: 5000 config is dead. Either implement a timeout (e.g. wrap fn() in Promise.race with a timeout, or remove it to avoid misleading callers. Given the PR title mentions no timeout behavior, removal is cleaner.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread guards_add_retry_logic.ts
lastError = e;
}
}
throw lastError;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: throw lastError can throw undefined when retries is 0

If opts.retries is 0, the loop never runs, lastError stays undefined, and throw lastError throws undefined (not a useful error). Guard for this, e.g. throw lastError ?? new Error("withRetry: no attempts made").


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 1
SUGGESTION 2
Issue Details (click to expand)

CRITICAL

File Line Issue
guards_add_retry_logic.ts 10 fn() is not awaited, so async rejections are never caught and the retry loop never runs for failed async calls

WARNING

File Line Issue
guards_add_retry_logic.ts 11 catch (e) is unreachable for async errors until await fn() is fixed

SUGGESTION

File Line Issue
guards_add_retry_logic.ts 2 timeout in DEFAULTS is never used (dead config)
guards_add_retry_logic.ts 15 throw lastError can throw undefined when retries is 0
Files Reviewed (1 files)
  • guards_add_retry_logic.ts - 4 issues

Fix these issues in Kilo Cloud


Reviewed by hy3-20260706:free · Input: 28.4K · Output: 2.2K · Cached: 83.2K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant