mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-10 02:30:39 +01:00
Two /tunnel/start calls that both saw the tunnel off each opened an ngrok session; the daemon kept only the second, so the first stayed public and closeTunnel could not reach it. ctx.tunnel.start is now single-flight, so a concurrent caller shares the in-flight start and its URL. A start that failed after ngrok.forward() reset only tunnelListener, leaving tunnelActive, tunnelUrl and tunnelServer set, so the daemon never idled out. The catch now clears all four. Tests found and first written by GEVA-449's pstack verification. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>