AOSSIE-Org / AOSSIE-Org/DebateAI

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

Đang mở
#484 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
TypeScript
Star
84
Fork
198
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
30

Mô tả

### 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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
72/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.