Repository navigation
Conversation
The PR view fetched the pull request and its files from the GitHub API without the user's token, so a private repository answered 404 and the view said the pull request does not exist. Pass the logged-in user's token from both places that open the view, the pulls command and the View Changes button.
- A revoked or expired token gets 401 even on a public repository, so the PR view retries without it instead of failing. - A logged-out user who opens a private-repo PR is told to log in instead of only being told the PR does not exist. - View Changes and View File fetch private-repo diffs and files through the GitHub API with the user's token. The token only goes to an API URL rebuilt from the github.com link, never to the link itself, since the link comes back from the client.
|
|
This was referenced Oct 2, 2026
austin-rt
marked this pull request as ready for review
October 2, 2026 17:46
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.
Issue(s)
Closes #160
Related to #19, #21, #140, #141
Acceptance Criteria fulfillment
Proposed changes (including videos or screenshots)
modals/pullDetailsModal.tstakes the user's token and sends it on both requests, the waylib/pullReqeustListMessage.tsandlib/repoDataMessage.tsalready do. If GitHub answers 401, it retries without the token, so a revoked or expired token does not break public repositories. When the request had no token, the "doesn't exist" message also says to log in.modals/fileCodeModal.tsfetches diffs and files through the GitHub API with the token. The button value is a github.com link that comes back from the client, so the token only goes to an API URL rebuilt from that link's owner, repo, number or commit and path, never to the link itself. Any other link is fetched without the token, as before.lib/commandUtility.tsandhandlers/ExecuteBlockActionHandler.tspass the logged-in user's token.Further comments
handlers/ExecuteViewClosedHandler.ts, opens the view without data and is left as it is.api.github.com, like the rest of these files. Reading it from theBaseApiHostIDsetting added in [Feat]: Add new GithubSDK class #144 belongs with GitHub Enterprise Server Support #111 and feat: Migrate GithubSDK To class Based. #143.modals/pullDetailsModal.tsandhandlers/ExecuteBlockActionHandler.tslike [FEAT]: Settings to hide individual actions in the pull request view #166, so whichever merges second needs a small rebase.