AOSSIE-Org / AOSSIE-Org/DebateAI

Role selection not locked + Ready allowed without role in OnlineDebateRoom

Open
#290 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
84
Forks
198
Avg merge
2d 19h
Merged PRs (30d)
30

Description

In the OnlineDebateRoom setup flow, users can currently select For/Against in ways that break debate consistency.

## Current Problems
1. Both users can choose the same role (ex: both choose "For")
2. Users can change role after selecting once
3. Users can click Ready without selecting a role
4. UI does not disable role buttons properly when opponent already selected that role

## Expected Behavior
- Only one user can choose "For" and only one can choose "Against"
- Once a user selects a role, it should be locked
- Ready should be blocked unless a role is selected
- Role buttons should disable correctly based on:
- peerRole
- localReady
- peerReady
- debatePhase != setup

## Steps to Reproduce
1. Open the same debate room in 2 browsers/incognito tabs
2. Both users select the same role (For)
3. Click Ready
4. Observe inconsistent role assignment / broken setup

## Proposed Fix
- Enforce role lock in backend WebSocket handler (handleRoleSelection)
- Block Ready unless role is selected (handleReadyStatus)
- Disable role buttons correctly in frontend setup popup

## Files
- backend/websocket/websocket.go
- frontend/src/Pages/OnlineDebateRoom.tsx

##Screen Recording:

https://github.com/user-attachments/assets/f25c844d-ab2c-40b7-a02c-609cb9c34008

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with handleRoleSelection and handleReadyStatus in backend/websocket/websocket.go, then inspect the setup popup in frontend/src/Pages/OnlineDebateRoom.tsx. Reproduce the flow in two browser sessions and verify that roles cannot conflict or change, Ready requires a role, and buttons reflect peerRole, localReady, peerReady, and debatePhase.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, typescript
Domain
backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.