From 154789f9325b271681cd11507cff2d3b0d5c5dd7 Mon Sep 17 00:00:00 2001 From: John Arban Lewis Date: Tue, 11 Jun 2024 10:29:01 -0400 Subject: [PATCH] make sure we always try to get the newest manifest available --- src/timestamps.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/timestamps.ts b/src/timestamps.ts index 75be019..5868bf6 100644 --- a/src/timestamps.ts +++ b/src/timestamps.ts @@ -14,7 +14,12 @@ export interface Manifest { export async function fetchManifest(): Promise { console.log("fetching manifest"); - return fetch("https://raw.githubusercontent.com/johnarban/tempo-data-holdings/main/manifest.json").then((response) => response.json()); + const url = "https://raw.githubusercontent.com/johnarban/tempo-data-holdings/main/manifest.json"; + // try to use cache busting, but if that fails try with plain url + return fetch(`${url}?version=${Date.now()}}`) + .then((response) => response.json()) + .catch(() => fetch(url).then((response) => response.json())); + } interface Timestamps {