From 2b4723e24a2292a0ae13544f3e50e98a0f8b580d Mon Sep 17 00:00:00 2001 From: Blodhgarm Date: Mon, 27 Apr 2026 14:39:12 -0500 Subject: [PATCH 1/2] Fix Reports page only giving 695 reports due to Labrinth Issue Basically, for some reason, Labrinth returns 5 less depending on the amount requested and the offset position, leading to the end of all reports, even if it's not correct. Signed-off-by: Blodhgarm --- apps/frontend/src/pages/moderation/reports/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/frontend/src/pages/moderation/reports/index.vue b/apps/frontend/src/pages/moderation/reports/index.vue index 4ced93ca44..12afb0fa24 100644 --- a/apps/frontend/src/pages/moderation/reports/index.vue +++ b/apps/frontend/src/pages/moderation/reports/index.vue @@ -119,7 +119,7 @@ const { data: allReports } = await useLazyAsyncData('new-moderation-reports', as const completed = await Promise.all(enrichmentPromises.splice(0, 2)) allReports.push(...completed.flat()) } - } while (reports.length === REPORT_ENDPOINT_COUNT) + } while (true) const remainingBatches = await Promise.all(enrichmentPromises) allReports.push(...remainingBatches.flat()) From 13117867e41a1193fcd2ece0e81ea2c3cd4ca2e0 Mon Sep 17 00:00:00 2001 From: Prospector <6166773+Prospector@users.noreply.github.com> Date: Thu, 30 Apr 2026 11:34:32 -0700 Subject: [PATCH 2/2] remove constant condition --- apps/frontend/src/pages/moderation/reports/index.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/frontend/src/pages/moderation/reports/index.vue b/apps/frontend/src/pages/moderation/reports/index.vue index 12afb0fa24..d4c09c21b0 100644 --- a/apps/frontend/src/pages/moderation/reports/index.vue +++ b/apps/frontend/src/pages/moderation/reports/index.vue @@ -103,12 +103,16 @@ const { data: allReports } = await useLazyAsyncData('new-moderation-reports', as const enrichmentPromises: Promise[] = [] let reports: Report[] - do { + let hasMoreReports = true + while (hasMoreReports) { reports = (await useBaseFetch(`report?count=${REPORT_ENDPOINT_COUNT}&offset=${currentOffset}`, { apiVersion: 3, })) as Report[] - if (reports.length === 0) break + hasMoreReports = reports.length > 0 + if (!hasMoreReports) { + break + } const enrichmentPromise = enrichReportBatch(reports) enrichmentPromises.push(enrichmentPromise) @@ -119,7 +123,7 @@ const { data: allReports } = await useLazyAsyncData('new-moderation-reports', as const completed = await Promise.all(enrichmentPromises.splice(0, 2)) allReports.push(...completed.flat()) } - } while (true) + } const remainingBatches = await Promise.all(enrichmentPromises) allReports.push(...remainingBatches.flat())