Skip to content

fix(server): pin a pull request's diff to its base commit - #9

Merged
fiddur merged 1 commit into
developfrom
pin-pr-ref
Aug 21, 2026
Merged

fix(server): pin a pull request's diff to its base commit#9
fiddur merged 1 commit into
developfrom
pin-pr-ref

Conversation

@fiddur

@fiddur fiddur commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

The ref comes from the URL, so a tab left open from an earlier session kept rendering a different
diff than the pull request's — under a header that still read "Changes from master", because the
description is instance-level while the diff follows the query parameter. #8 makes the stale ref
resolve to something sane; this makes it impossible for a PR view to show anything but the PR.

A /diff request whose ref disagrees with the pull request's base commit is redirected to it,
other query parameters preserved. Switching revision inside the UI is a client-side navigation that
never reaches the server, so exploring other revisions in an open session still works — reloading
returns to the pull request.

Verified:

GET /diff?ref=master               → 302 /diff?ref=24e3eeab4c…
GET /diff?ref=master&view=unified  → 302 /diff?ref=24e3eeab4c…&view=unified
GET /diff?ref=24e3eeab4c…          → 200

Stacked on #8.

🤖 Generated with Claude Code

https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs

The ref comes from the URL, so a tab left open from an earlier session — or a bookmark, or
a hand-edited address — kept rendering a different diff than the pull request's, under a
header that still read "Changes from master". A pull request's diff has to be the one
GitHub shows.

A /diff request whose ref disagrees with the pull request's base commit is now redirected
to it, with the other query parameters preserved. Switching revision inside the UI is a
client-side navigation and never reaches the server, so exploring other revisions in an
open session still works; reloading returns to the pull request.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
@fiddur
fiddur changed the base branch from ref-upstream to develop August 21, 2026 13:34
@fiddur
fiddur marked this pull request as ready for review August 21, 2026 13:34
@fiddur
fiddur merged commit 4d8ecef into develop Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant