Use GitHub's renamed page_data/stacks endpoint - #3
Merged
Merged
Conversation
GitHub renamed the stack page_data route from stack to stacks, so the old path returns 404 and every stack fell back to loading the full PR page. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub renamed the route behind the stack badge popup from
/pull/{n}/page_data/stackto/pull/{n}/page_data/stacks. The old path now returns 404 for every PR. Stacks were still grouped, but only because each one fell back to loading the full PR page and reading the embedded JSON. This PR switches to the new path, so it's one small JSON request per stack again.Evidence
/${owner}/pull/${n}/page_data/${routes.stack}, and the route table mapsstack:"stacks".page_data/stackreturns 404;page_data/stacksreturns 200 with the same{ stack: { id, number, size, baseBranch, pulls[...] } }shape. A PR that isn't stacked returnsstack: null.core.normalizeStackunchanged: stack 590391, size 3, PRs 477/475/469.Testing
node --testpasses 10/10.stacksrequest returns 200 and the PR page requests are gone.🤖 Generated with Claude Code