AOSSIE-Org / AOSSIE-Org/DebateAI

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

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

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.