Add logging for fetch operations in Webmentions component
All checks were successful
Deploy / deploy (push) Successful in 1m15s

This commit is contained in:
Adrian Altner 2026-04-22 01:45:24 +02:00
parent 42521444a8
commit 8003d501d4

View file

@ -48,6 +48,7 @@ async function fetchForTarget(target: string): Promise<WMEntry[]> {
console.warn('[webmentions] WEBMENTION_TOKEN is not set — skipping fetch.');
return [];
}
console.log(`[webmentions] fetching ${target} (token length: ${token.length})`);
const url = new URL(API);
url.searchParams.set('target', target);
url.searchParams.set('token', token);
@ -58,6 +59,7 @@ async function fetchForTarget(target: string): Promise<WMEntry[]> {
return [];
}
const json = (await res.json()) as WMResponse;
console.log(`[webmentions] → ${json.children?.length ?? 0} mentions`);
return json.children ?? [];
}