fix: address CodeRabbit review findings

- docker-table: inspect refetch result instead of .catch() (TQ v5 compat)
- rssFeed: sort all entries by date before slicing to max posts
- toValidDate: reject null/boolean inputs before Date construction
- system-resources: reset chart history when integrationIds changes
- settleIntegrationQueries: wrap fn in async boundary for safe allSettled
This commit is contained in:
Thomas Camlong committed 2026-06-27 12:13:52 +02:00
1 parent 45c58c967e
commit 12bf6ee4be
5 files changed
+18 -14

No files matched your search

+2 -2
View File
@@ -40,12 +40,12 @@ export const rssFeedRouter = createTRPCRouter({
logger.warn("RSS feed fetch failed", { url: urls[index], error: result.reason });
return [];
})
.slice(0, input.maximumAmountPosts)
.toSorted((entryA, entryB) => {
return entryA.published && entryB.published
? new Date(entryB.published).getTime() - new Date(entryA.published).getTime()
: 0;
});
})
.slice(0, input.maximumAmountPosts);
}),
});
+1 -1
View File
@@ -13,7 +13,7 @@ export async function settleIntegrationQueries<TIntegration extends IntegrationL
integrations: TIntegration[],
fn: (integration: TIntegration) => Promise<TResult>,
): Promise<TResult[]> {
const settled = await Promise.allSettled(integrations.map(fn));
const settled = await Promise.allSettled(integrations.map(async (integration) => fn(integration)));
return settled.flatMap((result, index) => {
if (result.status === "fulfilled") return [result.value];
const integration = integrations[index];