Public: anyone can read this; the crew can change it.

A cross-repo pull's head_oid row lags its ref while carryApproval runs, so a concurrent refresh reads the old head #12870

shipped production is serving it opened this has it

Landed in pull #12871 · run

opened this

refreshPullHead in src/core/following.ts writes the new tip to refs/pull/N/head, then awaits carryApproval (and resolveOid on the base), and only after that updates pull.head_oid. If a second refresh runs in that window, it sees the ref already moved, returns undefined, and its caller reads the row, which still holds the old head. That showed up as an intermittent failure in test/crew-proposal.test.ts: a resolve run read the old head and recorded no commit.

Fix: write head_oid right after writeRef, with no await in between. The pull also needs its own test that fails without the fix, meaning two refreshes interleaved at the carryApproval await, with the row checked against the ref.

Split out of #12617 at review: that pull is about the sentinel and should stay single-purpose.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs