diff --git a/.changeset/young-games-talk.md b/.changeset/young-games-talk.md new file mode 100644 index 0000000000..096dc02060 --- /dev/null +++ b/.changeset/young-games-talk.md @@ -0,0 +1,6 @@ +--- +"gitbook": patch +"gitbook-v2": patch +--- + +Revert investigation work around URL caches. diff --git a/packages/gitbook-v2/src/lib/context.ts b/packages/gitbook-v2/src/lib/context.ts index c85434c91f..22e25a5990 100644 --- a/packages/gitbook-v2/src/lib/context.ts +++ b/packages/gitbook-v2/src/lib/context.ts @@ -220,8 +220,6 @@ export async function fetchSiteContextByIds( ): Promise { 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 = { diff --git a/packages/gitbook/src/middleware.ts b/packages/gitbook/src/middleware.ts index 0e599c4486..30f7b44e6a 100644 --- a/packages/gitbook/src/middleware.ts +++ b/packages/gitbook/src/middleware.ts @@ -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),