AOSSIE-Org / AOSSIE-Org/DebateAI

[BUG] : WebSocket Connection Stability & Reconnection Logic

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

説明

## Problem
When the network drops during a live debate, `OnlineDebateRoom` does not show any connection status or recovery UI.
The screen freezes and users are forced to refresh, which often breaks the debate.

This makes real-time debates unreliable on unstable connections.

---

## What’s wrong
The WebSocket uses `ReconnectingWebSocket` but:
- No `onerror` or `onclose` handling
- No connection status in the UI
- Infinite retries with no user feedback
- RTC can fail while WebSocket looks connected

Users don’t know if the app is reconnecting or dead.

---

## Expected behavior
When the connection is lost:
- Show **Connected / Reconnecting / Disconnected**
- Show retry count (e.g. “Reconnecting 2/5”)
- Stop after a few retries
- Give buttons: **Retry** or **Leave Debate**

RTC state should also be reflected.

---

## Suggested fix
In `OnlineDebateRoom.tsx`:
- Track WebSocket state
- Add `onerror` and `onclose`
- Limit retries instead of `Infinity`
- Add a small connection status indicator

Similar logic already exists in `Matchmaking.tsx` and `ViewDebate.tsx`.

---

## Files
- `frontend/src/Pages/OnlineDebateRoom.tsx`

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

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

評価

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

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

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