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

Abierto
#2,104 1 comentario 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@Wikid82 ya está trabajando en esto.

Desde el 1/12/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
Go
Estrellas
17
Forks
2
Merge medio
1 h 42 min
PR fusionados (30 d)
173

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Wikid82/Charon

Todos los issues de Wikid82/Charon

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.