AOSSIE-Org / AOSSIE-Org/DebateAI

[BUG]: UpdateDebateVsBotOutcome silently updates nothing — filters on "userId" but is passed an email

Offen Anfängerfreundlich
#395 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
TypeScript
Sterne
84
Forks
198
Ø Merge
2 T. 19 Std.
Gemergte PRs (30 T.)
30

Beschreibung

### Bug Description

`backend/controllers/debatevsbot_controller.go` line 211 calls `db.UpdateDebateVsBotOutcome` passing the user's **email**, but the update filter in `backend/db/db.go` (lines 73-76) matches on a `userId` field, while the `DebateVsBot` model stores the value under `email` (`backend/models/debatevsbot.go` line 22). The filter matches zero documents, and the error return is swallowed by an empty `if err != nil { }` block (lines 211-212).

## Impact
The bot-debate outcome record is never updated; the feature only appears to work because `SaveDebateTranscript` (line 270-279) separately persists the result. Dead write + swallowed error hides the defect.

## Suggested Fix
Align the filter field with the model (`email`), and log/propagate the error instead of discarding it.

### Steps to Reproduce

_No response_

### Logs and Screenshots

_No response_

### Environment Details

_No response_

### Impact

Critical - Application is unusable

### Code of Conduct

- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start with backend/controllers/debatevsbot_controller.go lines 211-212, then compare the update filter in backend/db/db.go lines 73-76 with the email field in backend/models/debatevsbot.go line 22. Verify that the outcome update matches the stored identifier and that failures are no longer silently discarded; confirm the existing transcript-save flow remains intact.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
go
Bereich
backend, databases
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
74/100

Neue Issues direkt in Ihr Postfach

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