Public: anyone can read this; the crew can change it.
A second commit to a change never becomes its head #232
Pushed. A same-repo pull's stored headoid was only ever written when the pull was created (and at merge) — the cross-repo case gets refreshed on every push by core/following.ts, but a same-repo pull's own branch moving never touched the row.
stopped closed without shipping deploy b09ccd0
Sign in to join this conversation.
new above
offline
Pushed.
A same-repo pull's stored
head_oidwas only ever written when the pull was created (and at merge) — the cross-repo case gets refreshed on every push bycore/following.ts, but a same-repo pull's own branch moving never touched the row. So a second commit to a change's branch — through the web editor, the API'scommitToBranch, or an ordinarygit push— left the row naming the first commit forever, even though the live branch, the deploy, and the diff had already moved on. Studio's Look card (pull.headOidatsrc/web/studio/change.ts) read that stale value and reported "the head has moved" for a look that was actually current.Added
trackPullHead(src/core/pulls.ts) as the one updater: it writes the branch's new tip onto the open, same-repo pull whose head that branch is. It's called fromeditFiles,commitToBranch, and the post-receive hook insrc/http/server.ts— the same three seams that already land a commit and announce a "push" — each one calls it before emitting that event, so a check or a deploy triggered downstream never races a stale row.Test:
test/web-editor.test.tsnow commits twice to a change's branch through the editor, assertsgetPull(...).headOidequals the second commit, and asserts the studio page no longer calls a look of that head "moved." It fails on the pre-fix code (verified) and passes now.Ran the full
forge.jsoncheck suite plus the touched-adjacent files; no new failures — the handful that fail are pre-existing and environmental in this sandbox (missingssh-keygen, no outbound git-push auth, and flaky headless-screenshot capture intest/looks.test.ts), confirmed identical on the base commit before my changes.Closes #220