fix: notification sends started by domain and proxy host events use the request context

Offen
#2,104 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Wikid82 arbeitet bereits daran.

Seit 01.12.2026.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

backend

What

SendExternal is called with c.Request.Context() from handlers and then starts one goroutine per provider. Go cancels the request context when the handler returns, so a send that has not finished by then can fail with a cancelled-context error. Test sends use context.Background() and succeed.

Where

  • backend/internal/api/handlers/domain_handler.go (lines 54 and 74)
  • backend/internal/api/handlers/proxy_host_handler.go (lines 598 and 905)
  • backend/internal/services/notification_service.go (SendExternal, around line 214 onward)

Evidence

During container checks, Gotify sends triggered by creating a domain or proxy host failed with "outbound request failed: connection failed", while a test send a moment later succeeded. The call sites and the dispatch code are the same on development. The exact mapping from a cancelled context to that message was not confirmed.

Severity

Medium-low (event notifications may be dropped, intermittently).

Suggested approach

Pass a context detached from the request (for example context.WithoutCancel(ctx) with a timeout) into the goroutines, and add a test that returns from the handler before the sender completes.

Vorherrschende Sprache
Go
Sterne
17
Forks
2
Ø Merge
1 Std. 42 Min.
Gemergte PRs (30 T.)
173

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Wikid82/Charon

Alle Issues in Wikid82/Charon

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.