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

Aperta
#2,104 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Wikid82 ci sta già lavorando.

Dal 1/12/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
Go
Stelle
17
Fork
2
Merge medio
1h 42m
PR unite (30g)
173

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Wikid82/Charon

Tutte le issue di Wikid82/Charon

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.