From 57089e1ea5b088e8c1be4da8a8af2d9958d0bf9a Mon Sep 17 00:00:00 2001 From: Wessie Date: Fri, 3 Jan 2025 00:09:22 +0100 Subject: [PATCH] proxy: fix the proxy using a ctx value with a cancel that it shouldn't have --- proxy/api.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proxy/api.go b/proxy/api.go index 20d30d4d..0ec0c853 100644 --- a/proxy/api.go +++ b/proxy/api.go @@ -16,6 +16,13 @@ func (srv *Server) SourceStream(ctx context.Context) (eventstream.Stream[radio.P } func (srv *Server) KickSource(ctx context.Context, id radio.SourceID) error { + // make the ctx not have a cancel, this is a very specific behavior to this API + // because it spins off a goroutine that also gets the ctx, but once we return + // from this function the ctx gets canceled and everything in said goroutine fails + // + // also this function call is basically non-reverseable so having it be cancelable by + // the ctx doesn't make sense. + ctx = context.WithoutCancel(ctx) return srv.proxy.RemoveSourceClient(ctx, id) }