AOSSIE-Org / AOSSIE-Org/DebateAI

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

Ouverte
#484 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
TypeScript
Étoiles
84
Forks
198
Merge moyen
2 j 19 h
PR mergées (30 j)
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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
72/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.