Skip to content

Commit 490af4b

Browse files
cursoragentarmenzg
andcommitted
fix: Add missing limit:1 to prefetch query and remove optional chaining from required prop
- Add limit: 1 to coaleseIssueStatsPeriodQuery prefetch return to ensure only one item is fetched for polling - Remove optional chaining from deduplicateItems call since it's a required prop, preventing potential undefined crashes Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
1 parent 32f3553 commit 490af4b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

static/app/components/infiniteList/infiniteListItems.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function InfiniteListItems<ListItem, Response = Array<ApiResult<ListItem[
5454
queryResult,
5555
}: Props<ListItem, Response>) {
5656
const {data, hasNextPage, isFetchingNextPage, fetchNextPage} = queryResult;
57-
const loadedRows = deduplicateItems?.(data?.pages ?? []);
57+
const loadedRows = deduplicateItems(data?.pages ?? []);
5858
const parentRef = useRef<HTMLDivElement>(null);
5959

6060
const rowVirtualizer = useVirtualizer({

static/app/utils/feedback/coaleseIssueStatsPeriodQuery.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function coaleseIssueStatsPeriodQuery({
3838
const intervalMS = ONE_DAY_MS;
3939
const start = new Date(listHeadTime).toISOString();
4040
const end = new Date(listHeadTime + intervalMS).toISOString();
41-
return statsPeriod ? {start, end, statsPeriod: undefined} : undefined;
41+
return statsPeriod ? {limit: 1, start, end, statsPeriod: undefined} : undefined;
4242
}
4343

4444
const intervalMS = intervalToMilliseconds(statsPeriod ?? '');

0 commit comments

Comments
 (0)