Skip to content

Commit

Permalink
chore: mitigate #133 for now
Browse files Browse the repository at this point in the history
  • Loading branch information
hargoniX committed Jul 20, 2023
1 parent d65d26d commit 9b524d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions static/declaration-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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`));
Expand Down

0 comments on commit 9b524d7

Please sign in to comment.