Files
ngit-grasp/tests
DanConwayDev cb7e5ae0f9 fix(git): defer push completion until promotion
The large-push timeout reported in nostr:nevent1qqsyjly2u925qdc59cmxlxarvwagnr7pd6gpnr776x2mnfz6mdhn33cpz3mhxue69uhhyetvv9ujumn8d96zuer9wcj596eq led f4828c63 to stream receive-pack stdout. That change correctly kept libgit2 alive while Git spent 40-90 seconds resolving deltas and checking connectivity, but it also forwarded the terminal 0000 flush before process_newly_available_git_data ran.

Git clients treat that flush as the semantic end of receive-pack and do not need to wait for HTTP EOF. A standard GRASP push could therefore return from nostr_push while its kind-30617 announcement and kind-30618 state were still in purgatory. Immediate clone or proposal setup then intermittently observed a repository that was not queryable yet. This is the server-side cause exposed by ngit git_push_merge setup.

Continue streaming every preceding progress byte, but retain the final four-byte flush. After a successful receive-pack, promote and save the matching events, align refs and HEAD, notify subscribers, and only then release the flush. Preserve the existing failure response path when Git itself fails.

The regression blocks announcement promotion and proves progress remains visible, the terminal flush remains hidden, and the event is queryable before completion is released. This applies to the standard announced-repository receive-pack path; the GRASP-06 /prs handler has its own completion and cleanup pipeline.

Regression-from: f4828c6393

Related: nostr:nevent1qqs279s9sxvcuf2g9kq6d25nxkg6x2thcrvg9lzfzrdxt0kzpnlcykqpz3mhxue69uhhyetvv9ujuerpd46hxtnfdumztv34
2026-07-26 02:26:30 +01:00
..