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

Ouverte
#2,104 1 commentaire 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@Wikid82 y travaille déjà.

Depuis le 1/12/2026.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

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.

Langage dominant
Go
Étoiles
17
Forks
2
Merge moyen
1 h 42 min
PR mergées (30 j)
173

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Wikid82/Charon

Toutes les issues de Wikid82/Charon

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.