Repository navigation
fix(github): load PR uploads from private repositories - #23
Conversation
A private repository's `github.com/user-attachments/assets/<id>` URL is a 404 to any token, so the media fetch came back empty and clients drew blank tiles. When that URL is a 404, ask GitHub to render it in the change request's repository, which yields a short-lived signed link, and fetch that instead. Mobile and web now send the repository with the media resource. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged fork main (d6ef174) into the branch at 09fb563. The merge had no conflicts.
The APK linked in the description is from before the merge (05fa731). 🤖 Generated with Claude Code |
The signed-link cache was keyed only by attachment and repository, so after switching GitHub accounts or signing out, a link signed for the previous account was still served for up to a minute. Key it by the credential's fingerprint and render with that credential pinned, the way the PR API keys its caches, and render nothing without a credential. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review fix, 23c7fdf A cross-provider review (gpt-6.1-sol) found that the signed-link cache was keyed only by attachment and repository. After an account switch or sign-out, a link GitHub had signed for the previous credential could be served for up to a minute. The cache key now includes the credential fingerprint, the same way
Not rerun on a live server or device since the merge; the earlier live check went through the same 🤖 Generated with Claude Code |
…-attachments Upstream landed its own repository plumbing and signed-link rendering for GitHub media (pingdotgg#21631, pingdotgg#21632), so this branch takes main's version of every file it had changed. The private-repository fallback follows on top. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub answers a token's request for an upload in a private repository with a plain 404, so only an SSO sign-in page led to a rendered signed URL and private repositories showed blank attachments. After a 404, look up the repository's visibility (cached for an hour) and render the signed URL only when it is private. Public repositories, ones the account cannot see, and requests without a repository keep their 404. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An account that cannot read a private repository reused another account's cached "private" answer and rendered its uploads anyway. Key the visibility cache by the credential fingerprint as well, so that account looks the repository up itself and keeps its 404. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review: gpt-6.1-sol (Codex, high effort) approves 381f9aa
No blockers are open. The 🤖 Generated with Claude Code |
Image attachments in a private repository's pull request still show as blank tiles on Android and as broken images on web. Upstream's fix, now on main (pingdotgg#21631, pingdotgg#21632), renders a signed URL through
POST /markdown, but only when the upload URL answers with an SSO sign-in page. Without SSO, GitHub answers a token's request for a private repository's upload with a plain404 text/plain, so main passes the 404 through.The fix
After a 404 for an upload whose repository is known, the GitHub media fetch reads
GET /repos/{owner}/{name}. It renders the signed URL only when the repository isprivate: true. Upstream's render, signed-URL cache and checks then run unchanged.This PR first carried its own version of the repository plumbing and render. Main now has upstream's equivalent, so the branch takes main's version of every file (merge b1925ae) and adds only the 404 case in
gitHubMediaFetch.ts.Verification
fetch, the token, noAccept), a private repository's upload answers404 text/plain. With a browser-styleAcceptit answers404 text/html, but the server doesn't forwardAccept.GET /repos/<private repository>returnsprivate: true, andpingdotgg/t3codereturnsprivate: false.renders an upload in a private repository…failed on main (expected 200, got 404) and passes now.leaves a 404 alone unless the repository is known to be privatecovers public, unreadable, and no-repository requests.gitHubMediaFetch,driverandAssetAccesstests pass, as do lint, format, knip and thesource-control-githubtypecheck.200 image/png) used this branch's previous version of the same render: https://artifacts.ghostsignal.nexus/k/t3code-private-pr-attachments-webrepositoryfield the APK sends. It needs a server running this branch: https://artifacts.ghostsignal.nexus/k/t3code-private-pr-attachmentsDone with Claude Opus 5.5 in Claude Code, running in T3 Code.
🤖 Generated with Claude Code