-
Notifications
You must be signed in to change notification settings - Fork 155
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:
"eloChange": 0, // TODO: Add actual Elo change trackingThe 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
- Model Update: Add an
EloChange(float64) field to theSavedDebateTranscriptstruct inbackend/models/transcript.go. - Service Update: Modify
SaveDebateTranscriptinbackend/services/transcriptservice.goto accept theeloChangeas a parameter. - Logic Refactor: In
JudgeDebateworkflows, reorder operations so thatUpdateRatingsis called beforeSaveDebateTranscript. Pass the calculated rating delta (fromdebateRecord.RatingChange) to the save function. - Controller Update: Update
backend/controllers/profile_controller.goto read and return the storedtranscript.EloChangeinstead of the hardcoded0.
@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.