Revert investigation work around URL caches. (#3183)

This commit is contained in:
Steven H
2025-04-23 16:53:33 +01:00
committed by GitHub
parent 97b7c79bc6
commit dd043df00f
3 changed files with 6 additions and 21 deletions
+6
View File
@@ -0,0 +1,6 @@
---
"gitbook": patch
"gitbook-v2": patch
---
Revert investigation work around URL caches.
-18
View File
@@ -220,8 +220,6 @@ export async function fetchSiteContextByIds(
): Promise<GitBookSiteContext> {
const { dataFetcher } = baseContext;
const DEBUG = ids.site === 'site_cu2ih';
const [{ site: orgSite, structure: siteStructure, customizations, scripts }, spaceContext] =
await Promise.all([
throwIfDataError(
@@ -234,22 +232,6 @@ export async function fetchSiteContextByIds(
fetchSpaceContextByIds(baseContext, ids),
]);
DEBUG && console.log('ids', JSON.stringify(ids));
DEBUG &&
console.log(
'siteStructure',
siteStructure
? JSON.stringify({
type: siteStructure.type,
structure: siteStructure.structure.map((s) => {
// @ts-ignore
const { siteSpaces, urls, ...rest } = s;
return rest;
}),
})
: 'null'
);
// override the title with the customization title
// TODO: remove this hack once we have a proper way to handle site customizations
const site = {
-3
View File
@@ -674,9 +674,6 @@ async function lookupSiteByAPI(
}
);
alternative.url.includes('minas-tirith') &&
console.log(`resolved ${alternative.url} -> ${JSON.stringify(data)}`);
if ('error' in data) {
if (alternative.primary) {
// We only return an error for the primary alternative (full URL),