AOSSIE-Org / AOSSIE-Org/DebateAI

[BUG]: Speech recognition in DebateRoom fails silently on unsupported browsers and lacks feedback on permission denial

未关闭
#484 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
TypeScript
星标
84
派生
198
平均合并
2 天 19 小时
30 天内合并 PR
30

描述

### Bug Description

In `DebateRoom.tsx`, the Speech-to-Text feature relies on the Web Speech API (`SpeechRecognition` / `webkitSpeechRecognition`). Currently:
1. **Unsupported Browsers (e.g., Firefox, Brave):** `recognitionRef.current` remains `null`. Clicking the microphone button does nothing silently without explaining why to the user.
2. **Permission Denied (e.g., Chrome/Edge):** When a user denies or dismisses the browser's microphone permission prompt, `onerror` fires with `"not-allowed"`. The app handles this internally by turning off the recording state, but displays **no message or notification to the user**.
---

### Steps to Reproduce

**Test 1 (Unsupported Browser):**
1. Open the app in **Firefox**.
2. Go to `/startDebate` -> **Practice with Bot** -> enter `DebateRoom`.
3. Click the microphone button.
4. *Observed:* Nothing happens; no error or message is shown.

**Test 2 (Permission Denied in Chrome):**
1. Open the app in **Google Chrome**.
2. Enter `DebateRoom` and click the microphone button.
3. Click **Block** or close the browser permission prompt.
4. Click the microphone button again.
5. *Observed:* The mic toggles briefly and resets, but no feedback explains that permission was denied.
---

### Logs and Screenshots

_No response_

### Environment Details

OS: linux (ubuntu)
browser: firefox, chrome
node: v20.20.2

### Impact

Medium - Feature works but has issues

### Code of Conduct

- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start in DebateRoom.tsx by tracing the microphone button, recognitionRef.current setup, and the onerror handler. Reproduce the unsupported-browser case in Firefox and the permission-denied case in Chrome, then verify that each condition gives the user feedback and that recording still resets correctly.

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
72/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。