Skip to content

Commit 2ac46e8

Browse files
committed
fix(api): align listLogs default statsPeriod with 30d retention limit
The API-layer fallback was 14d while the CLI default was 30d — a maintenance footgun for future direct callers. Both should match the 30-day log retention period.
1 parent 85ee2ad commit 2ac46e8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/api/logs.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ type ListLogsOptions = {
4949
query?: string;
5050
/** Maximum number of log entries to return */
5151
limit?: number;
52-
/** Time period for logs (e.g., "90d", "10m") */
52+
/**
53+
* Time period for logs (e.g., "30d", "14d", "10m").
54+
* Defaults to "30d" — the maximum log retention period.
55+
* Periods >30d hit a degraded API path returning stale/incomplete data.
56+
*/
5357
statsPeriod?: string;
5458
/** Sort direction: "newest" (default) or "oldest" */
5559
sort?: LogSortDirection;
@@ -93,7 +97,7 @@ export async function listLogs(
9397
project: isNumericProject ? [Number(projectSlug)] : undefined,
9498
query: fullQuery || undefined,
9599
per_page: options.limit || API_MAX_PER_PAGE,
96-
statsPeriod: options.statsPeriod ?? "14d",
100+
statsPeriod: options.statsPeriod ?? "30d",
97101
sort: toApiSort(options.sort),
98102
},
99103
});

0 commit comments

Comments
 (0)