fix(music): autoplay rejections are only logged and never retried

Aperta
#499 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start with the rejection handlers at modules/music/src/music.library.ts:70-73 and modules/sound/src/sound.library.ts:62-64, then trace how music starts in main and how input events are registered. Check existing tests around playback and input handling, or add coverage for AbortError and NotAllowedError. Done means aborted switches are not logged as errors and blocked music retries after the first pointerdown or keydown.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug modules:music modules:sound
Which package is this bug report for?

music

Issue description

A NotAllowedError (autoplay blocked before a user gesture) is only logged as Got error: …, and _current points to a track that is not playing, so menu music started in main stays silent for the whole session. An expected AbortError (switching tracks quickly) is logged as an error too.

Where:

Evidence:

this._current.play().catch((error: unknown) => {
  console.error(`Got error: ${error}`);
});

Suggested fix: Ignore AbortError. On NotAllowedError, keep the pending track and retry on the first pointerdown / keydown.

Found during a code audit of main at be72076.

Code sample

No response

Versions
  • Engine main at be72076
  • pnpm 12.0.0, Node.js 26, Bun 1.3.14
Issue priority

Medium (should be fixed soon)

I have tested this issue on a development release

be72076

Lingua principale
TypeScript
Stelle
7
Fork
2
Merge medio
1g 17h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NanoForge-dev/Engine

Tutte le issue di NanoForge-dev/Engine

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.