AOSSIE-Org / AOSSIE-Org/DebateAI
[BUG]: Elo rating changes are not tracked in debate history
- Dominant language
- TypeScript
- Stars
- 84
- Forks
- 198
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
**Description**
This issue addresses a missing feature in the debate history tracking where the Elo rating change is not recorded or displayed for past matches.
**Problem**
In `backend/controllers/profile_controller.go`, the code attempts to display the rating change but currently uses a placeholder:
```go
"eloChange": 0, // TODO: Add actual Elo change tracking
```
The SavedDebateTranscript model lacks a field to store this specific data point. Additionally, the service logic currently saves the transcript before the rating calculation is performed, meaning the rating delta is lost effectively immediately after the match concludes.
**Root Cause**
The functionality was marked as a TODO but never implemented. The database model and the service workflow do not support persisting the EloChange value.
**Impact**
* Users see a "+0" or "0" change for all matches in their "Recent Debates" list.
* There is no historical record of how individual matches affected a user's ranking.
* Profile analytics regarding rating progression are incomplete.
**Suggested Fix**
1. **Model Update**: Add an `EloChange` (float64) field to the `SavedDebateTranscript` struct in `backend/models/transcript.go`.
2. **Service Update**: Modify `SaveDebateTranscript` in `backend/services/transcriptservice.go` to accept the `eloChange` as a parameter.
3. **Logic Refactor**: In `JudgeDebate` workflows, reorder operations so that `UpdateRatings` is called *before* `SaveDebateTranscript`. Pass the calculated rating delta (from `debateRecord.RatingChange`) to the save function.
4. **Controller Update**: Update `backend/controllers/profile_controller.go` to read and return the stored `transcript.EloChange` instead of the hardcoded `0`.
@bhavik-mangla, I would like to work on this issue. I've reviewed the backend code and have a plan to implement the missing Elo change tracking. Please assign it to me.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing SaveDebateTranscript in backend/services/transcriptservice.go and the JudgeDebate workflows to confirm when rating calculation and transcript saving occur. Review the SavedDebateTranscript model in backend/models/transcript.go and the response assembly in backend/controllers/profile_controller.go. Done means the calculated rating delta is persisted and Recent Debates returns it instead of 0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100