fix: scope polling to widgets, fix retry, guard dates, throttle umami

- Remove global refetchInterval; scope to widget queries via setQueryDefaults
- Fix error boundary retry: correct queryKey to [["widget"]], move invalidation to onReset
- Add toValidDate() helper in @homarr/common for cache hydration safety
- Guard date formatting in media-releases and media-requests against non-Date values
- Set umami refetchInterval to 60s via shared umamiQueryOptions constant
- Simplify dns-hole mutations to invalidate() instead of manual optimistic setData
This commit is contained in:
Thomas Camlong committed 2026-06-25 17:38:13 +02:00
1 parent 210a62b35a
commit c848dbfc1f
11 files changed
+84 -114

No files matched your search

+5
View File
@@ -17,6 +17,11 @@ export function formatDuration(milliseconds: number) {
return `${minutes}:${String(seconds).padStart(2, "0")}`;
}
export const toValidDate = (value: unknown): Date | null => {
const date = value instanceof Date ? value : new Date(value as string | number);
return Number.isFinite(date.getTime()) ? date : null;
};
export const isDateWithin = (date: Date, relativeDate: string): boolean => {
if (relativeDate.length < 2) {
throw new Error("Relative date must be at least 2 characters long");