From 9b524d7c5a4f8ddf2bc5743a0b5c405d9a2690d7 Mon Sep 17 00:00:00 2001 From: Henrik Date: Thu, 20 Jul 2023 23:41:44 +0200 Subject: [PATCH] chore: mitigate #133 for now --- static/declaration-data.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/declaration-data.js b/static/declaration-data.js index 88dc85c..5dbb5fe 100644 --- a/static/declaration-data.js +++ b/static/declaration-data.js @@ -62,7 +62,8 @@ export class DeclarationDataCenter { // undefined. then fetch the data from the server. const dataListRes = await fetch(dataListUrl); const data = await dataListRes.json(); - await cacheDeclarationData(data); + // TODO https://github.com/leanprover/doc-gen4/issues/133 + // await cacheDeclarationData(data); return new DeclarationDataCenter(data); } } @@ -272,7 +273,12 @@ async function fetchCachedDeclarationData() { return new Promise((resolve, reject) => { let transactionRequest = store.get(CACHE_DB_KEY); transactionRequest.onsuccess = function (event) { - resolve(event.target.result); + // TODO: This API is not thought 100% through. If we have a DB cached + // already it will not even ask the remote for a new one so we end up + // with outdated declaration-data. This has to have some form of cache + // invalidation: https://github.com/leanprover/doc-gen4/issues/133 + //resolve(event.target.result); + resolve(undefined); }; transactionRequest.onerror = function (event) { reject(new Error(`fail to store declaration data`));