[Majeur] GET /channels/{id} renvoie toujours 500 (LINQ non traduisible) #97

Closed
opened 2026-10-28 10:31:57 +00:00 by asventi · 0 comments
Owner

Gravité : Majeur
Rapports QA d'origine : CHAT-04, FRIENDS-03, EVENTS-17, SECURITY_UX-04

GetChannelQuery.cs:12-15 : la requête n'est pas traduisible par EF Core, l'endpoint échoue pour tous les channels.

Détails des rapports

[CHAT-04] `GET /api/channels/{id}` renvoie toujours 500 — Gravité : Majeur
  • Où : GET /api/channels/{id} (id existant ou non).
  • Obtenu : 500 System.InvalidOperationException: The LINQ expression 'DbSet<Channel>()...ChannelResponse.FromEntity(c).Id == @id' could not be translated. Même un id inconnu donne 500 au lieu de 404. Le front n'utilise pas cet endpoint (il liste tout), mais l'API documentée est cassée et CreatedAtRoute("channels.get") (Location header) pointe dessus.
  • Cause : backend/API/Channels/Get/GetChannelQuery.cs : .Select(c => ChannelResponse.FromEntity(c)) (méthode non traduisible EF) suivi de .SingleOrDefaultAsync(c => c.Id == id).
  • Note : la réponse 500 expose exception.details (stack trace complète) -> fuite d'informations (probablement mode Development).
[FRIENDS-03] `GET /api/channels/{id}` renvoie 500 pour tous les canaux (LINQ non traduisible) — Gravité : Mineur (hors scope strict, vu en passant)
  • Où : GET /api/channels/{id} (testé sur un DM et sur un canal texte existant)
  • Obtenu : 500 System.InvalidOperationException: The LINQ expression 'DbSet<Channel>() .Where(...ChannelResponse.FromEntity(c).Id == @id)' could not be translated.
  • Cause probable : backend/API/Channels/Get/GetChannelQuery.cs : .Select(c => ChannelResponse.FromEntity(c)) suivi de .SingleOrDefaultAsync(c => c.Id == id).
[EVENTS-17] (hors scope events, constaté en passant) `GET /api/channels/{id}` renvoie 500 pour n'importe quel channel — Gravité : Majeur
  • GET /channels/<id d'un channel normal> -> 500 InvalidOperationException: The LINQ expression 'DbSet<Channel>() ... ChannelResponse.FromEntity(c)' could not be translated. Cause probable : backend/API/Channels/Get/GetChannelQuery.cs:12-15 (.Select(c => ChannelResponse.FromEntity(c)) côté SQL). À transmettre au testeur chat.
[SECURITY_UX-04] `GET /api/channels/{id}` renvoie toujours 500 — Gravité : Majeur
  • Où : GET /api/channels/{id} (canal texte, privé ou DM, peu importe)
  • Étapes : 1. connecté (Member) GET /api/channels/<id existant>
  • Attendu : 200 + canal (ou 403/404)
  • Obtenu : 500 InvalidOperationException: The LINQ expression ... ChannelResponse.FromEntity(c).Id == @id could not be translated (détail + stack trace dans la réponse)
  • Cause probable : backend/API/Channels/Get/GetChannelQuery.cs : .Select(c => ChannelResponse.FromEntity(c)) exécuté côté SQL avant .SingleOrDefaultAsync(c => c.Id == id) ; en plus aucun contrôle d'accès (whitelist) dans cette query.

Trouvé par une campagne de tests QA automatisés (agents Claude, Playwright) sur l'environnement de dev. Les captures citées sont locales et non jointes.

**Gravité :** Majeur **Rapports QA d'origine :** CHAT-04, FRIENDS-03, EVENTS-17, SECURITY_UX-04 `GetChannelQuery.cs:12-15` : la requête n'est pas traduisible par EF Core, l'endpoint échoue pour tous les channels. ## Détails des rapports <details><summary>[CHAT-04] `GET /api/channels/{id}` renvoie toujours 500 — Gravité : Majeur</summary> - Où : `GET /api/channels/{id}` (id existant ou non). - Obtenu : 500 `System.InvalidOperationException: The LINQ expression 'DbSet<Channel>()...ChannelResponse.FromEntity(c).Id == @id' could not be translated`. Même un id inconnu donne 500 au lieu de 404. Le front n'utilise pas cet endpoint (il liste tout), mais l'API documentée est cassée et `CreatedAtRoute("channels.get")` (Location header) pointe dessus. - Cause : `backend/API/Channels/Get/GetChannelQuery.cs` : `.Select(c => ChannelResponse.FromEntity(c))` (méthode non traduisible EF) suivi de `.SingleOrDefaultAsync(c => c.Id == id)`. - Note : la réponse 500 expose `exception.details` (stack trace complète) -> fuite d'informations (probablement mode Development). </details> <details><summary>[FRIENDS-03] `GET /api/channels/{id}` renvoie 500 pour tous les canaux (LINQ non traduisible) — Gravité : Mineur (hors scope strict, vu en passant)</summary> - Où : `GET /api/channels/{id}` (testé sur un DM et sur un canal texte existant) - Obtenu : 500 `System.InvalidOperationException: The LINQ expression 'DbSet<Channel>() .Where(...ChannelResponse.FromEntity(c).Id == @id)' could not be translated`. - Cause probable : `backend/API/Channels/Get/GetChannelQuery.cs` : `.Select(c => ChannelResponse.FromEntity(c))` suivi de `.SingleOrDefaultAsync(c => c.Id == id)`. </details> <details><summary>[EVENTS-17] (hors scope events, constaté en passant) `GET /api/channels/{id}` renvoie 500 pour n'importe quel channel — Gravité : Majeur</summary> - `GET /channels/<id d'un channel normal>` -> 500 `InvalidOperationException: The LINQ expression 'DbSet<Channel>() ... ChannelResponse.FromEntity(c)' could not be translated`. Cause probable : `backend/API/Channels/Get/GetChannelQuery.cs:12-15` (`.Select(c => ChannelResponse.FromEntity(c))` côté SQL). À transmettre au testeur chat. </details> <details><summary>[SECURITY_UX-04] `GET /api/channels/{id}` renvoie toujours 500 — Gravité : Majeur</summary> - Où : `GET /api/channels/{id}` (canal texte, privé ou DM, peu importe) - Étapes : 1. connecté (Member) `GET /api/channels/<id existant>` - Attendu : 200 + canal (ou 403/404) - Obtenu : 500 `InvalidOperationException: The LINQ expression ... ChannelResponse.FromEntity(c).Id == @id could not be translated` (détail + stack trace dans la réponse) - Cause probable : `backend/API/Channels/Get/GetChannelQuery.cs` : `.Select(c => ChannelResponse.FromEntity(c))` exécuté côté SQL avant `.SingleOrDefaultAsync(c => c.Id == id)` ; en plus aucun contrôle d'accès (whitelist) dans cette query. </details> --- _Trouvé par une campagne de tests QA automatisés (agents Claude, Playwright) sur l'environnement de dev. Les captures citées sont locales et non jointes._
Equoo self-assigned this 2026-10-28 10:59:37 +00:00
Equoo closed this issue 2026-10-29 10:18:52 +00:00
Equoo referenced this issue from a commit 2026-10-29 10:19:07 +00:00
Equoo referenced this issue from a commit 2026-10-29 13:05:36 +00:00
Equoo referenced this issue from a commit 2026-10-31 19:16:18 +00:00
asventi referenced this issue from a commit 2026-11-02 13:08:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transcendence/backend#97
No description provided.