From 61b47cf1bb42f2c1cda6d6183b472517072e4a37 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Thu, 27 Aug 2026 15:02:13 -0400 Subject: Follow the commit history to its new home in the payload GitHub moved commitGroups from the top of the embedded JSON into a commitsRefRoute, alongside the code view's own routes, so every commits page threw. The groups themselves are unchanged. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01BErPR92xppzGFXkPqXPYj2 --- src/scraper.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/scraper.ts b/src/scraper.ts index 1a67d05..c02cb5e 100644 --- a/src/scraper.ts +++ b/src/scraper.ts @@ -139,6 +139,10 @@ interface CodeViewBlobLayoutRouteStyledBlob { stylingDirectives: StylingDirective[][] | null; } +interface CommitsRefRoute { + commitGroups: CommitGroup[]; +} + interface CodeViewBlobRoute { richText: string | null; renderedFileInfo?: { renderFileType: string | null } | null; @@ -161,7 +165,7 @@ interface AppPayload { codeViewBlobLayoutRoute?: CodeViewBlobLayoutRoute; "codeViewBlobLayoutRoute.StyledBlob"?: CodeViewBlobLayoutRouteStyledBlob; codeViewBlobRoute?: CodeViewBlobRoute; - commitGroups?: CommitGroup[]; + commitsRefRoute?: CommitsRefRoute; // Actually there may be other query types. preloadedQueries?: IssueIndexPageQuery[]; } @@ -648,8 +652,9 @@ export async function getGitHubCommits( const html = await fetchGitHubPage(urlPath); const payload = parsePayload(html); + const commitsRoute = payload?.commitsRefRoute; - if (payload?.commitGroups === undefined) { + if (commitsRoute === undefined) { throw new Error("Could not find commit history in embedded JSON"); } @@ -660,7 +665,7 @@ export async function getGitHubCommits( }, branch, path, - commitGroups: payload.commitGroups, + commitGroups: commitsRoute.commitGroups, }; } -- cgit v1.3.1