Skip to content

Commit dd043df

Browse files
authored
Revert investigation work around URL caches. (#3183)
1 parent 97b7c79 commit dd043df

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

.changeset/young-games-talk.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"gitbook": patch
3+
"gitbook-v2": patch
4+
---
5+
6+
Revert investigation work around URL caches.

packages/gitbook-v2/src/lib/context.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ export async function fetchSiteContextByIds(
220220
): Promise<GitBookSiteContext> {
221221
const { dataFetcher } = baseContext;
222222

223-
const DEBUG = ids.site === 'site_cu2ih';
224-
225223
const [{ site: orgSite, structure: siteStructure, customizations, scripts }, spaceContext] =
226224
await Promise.all([
227225
throwIfDataError(
@@ -234,22 +232,6 @@ export async function fetchSiteContextByIds(
234232
fetchSpaceContextByIds(baseContext, ids),
235233
]);
236234

237-
DEBUG && console.log('ids', JSON.stringify(ids));
238-
DEBUG &&
239-
console.log(
240-
'siteStructure',
241-
siteStructure
242-
? JSON.stringify({
243-
type: siteStructure.type,
244-
structure: siteStructure.structure.map((s) => {
245-
// @ts-ignore
246-
const { siteSpaces, urls, ...rest } = s;
247-
return rest;
248-
}),
249-
})
250-
: 'null'
251-
);
252-
253235
// override the title with the customization title
254236
// TODO: remove this hack once we have a proper way to handle site customizations
255237
const site = {

packages/gitbook/src/middleware.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,6 @@ async function lookupSiteByAPI(
674674
}
675675
);
676676

677-
alternative.url.includes('minas-tirith') &&
678-
console.log(`resolved ${alternative.url} -> ${JSON.stringify(data)}`);
679-
680677
if ('error' in data) {
681678
if (alternative.primary) {
682679
// We only return an error for the primary alternative (full URL),

0 commit comments

Comments
 (0)