AOSSIE-Org / AOSSIE-Org/DebateAI

[Bug] Online Matchmaking Gets Stuck in “Searching” State

オープン
#203 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
84
フォーク
198
平均マージ
2日 19時間
マージ済み PR(30日)
30

説明

### 📌 Description
When a user joins **Online Matchmaking**, the UI correctly shows the user as being added to the queue and the search timer starts. However, **no match is ever created**, even when compatible players are present or when multiple users join the queue over time.

This results in users being stuck indefinitely in the **“Searching…”** state.

---

### 🔁 Steps to Reproduce
1. Go to **Start Debate → Matchmaking**
2. Click **Find a Debate Partner**
3. Observe:
- Timer starts (`Searching…`)
- User appears under **Players in Queue**
4. Open another browser or incognito window with a different account
5. Join matchmaking again with a compatible Elo range
6. ❌ No match is created; both users remain in the queue

---

### 📷 Screenshot

Image

### ✅ Expected Behavior
- When two compatible users (with overlapping Elo ranges) are present in the queue:
- A debate room should be created automatically
- Both users should be removed from the queue
- Both clients should receive a `match_found` WebSocket event
- Users should be redirected to the debate room

---

### ❌ Actual Behavior
- Users are successfully added to the matchmaking queue
- The search timer continues indefinitely
- No debate room is created
- No `match_found` event is emitted
- Users must manually cancel matchmaking

---

### 🧠 Possible Root Causes
- Matchmaking logic runs **only once on join**, not periodically
- No background worker or loop to continuously check the queue
- Elo range matching condition may be too strict or incorrect
- Matched users are not removed atomically from the queue
- Match creation event is not emitted over WebSocket

---

### 💡 Suggested Fix
- Add a **periodic matchmaking worker** (e.g., every 1 second) to process the queue
- Use **overlapping Elo range matching logic**
- Ensure matched users are removed atomically from the queue
- Emit a `match_found` WebSocket event to both matched users

---

#### 🧪 Environment

- OS: Any
- Browser: Chrome / Firefox
- Frontend: React (Vite)
- Backend: Go
- Matchmaking Mode: Online Matchmaking

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。