From a5bebe2b487fe5433b012fbf9edb00d031ed7182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efra=C3=ADn=20Roch=C3=ADn?= Date: Tue, 11 Apr 2023 07:51:27 -0700 Subject: [PATCH] bugfix/sync-not-working-properly (#8168) --- apps/web/pages/[user]/calendar-cache/[month].tsx | 2 +- packages/core/CalendarManager.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/web/pages/[user]/calendar-cache/[month].tsx b/apps/web/pages/[user]/calendar-cache/[month].tsx index d866b027a2..8eff9ad2fc 100644 --- a/apps/web/pages/[user]/calendar-cache/[month].tsx +++ b/apps/web/pages/[user]/calendar-cache/[month].tsx @@ -47,7 +47,7 @@ export const getStaticProps: GetStaticProps< revalidate: 1, }; } catch (error) { - let message = "Unknown error while fetching calendarÆ’"; + let message = "Unknown error while fetching calendar"; if (error instanceof Error) message = error.message; console.error(error, message); return { diff --git a/packages/core/CalendarManager.ts b/packages/core/CalendarManager.ts index 9a5c312949..4d3ee42cf1 100644 --- a/packages/core/CalendarManager.ts +++ b/packages/core/CalendarManager.ts @@ -193,6 +193,9 @@ const getNextCache = async (username: string, month: string): Promise r.json()) .then((json) => json?.pageProps?.results); + // No need to wait for this, the purpose is to force re-validation every second as indicated + // in page getStaticProps. + fetch(`${baseUrl}/${username}/calendar-cache/${month}`).catch(console.log); } catch (e) { log.warn(e); }