getUiData never settles when its responder is unmounted (CURRENT_PAGE_SNAPSHOT while the presentation is minimised)

Aperta Adatta ai principianti
#289 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
api

Direzione di ricerca

Inizia in src/ui-data/getters/getters.ts, alla Promise creata da pluginApi.getUiData, quindi traccia come vengono gestiti l'evento di risposta e il listener di window. Riproduci il caso del responder mancante con CURRENT_PAGE_SNAPSHOT mentre la presentazione è minimizzata. Il lavoro è completato quando il getter si risolve tramite il percorso di timeout concordato e le chiamate ripetute non mantengono i listener.

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

Descrizione

Describe the bug

pluginApi.getUiData(...) returns a Promise that settles only when the client dispatches the
matching response event. If no responder is mounted, nothing ever happens: there is no timeout and
no reject path, so the caller waits forever with no error to react to.

This is reachable in normal use, because some responders live inside UI that can disappear.
PresentationWhiteboardUiDataNames.CURRENT_PAGE_SNAPSHOT is answered by presentation-menu, which
sits inside the presentation area and unmounts when the user minimises the presentation. From that
moment every getUiData(CURRENT_PAGE_SNAPSHOT) call hangs.

A plugin that polls (bbb-plugin-picture-in-picture refreshes the slide every 5s) then accumulates
one pending Promise and one window listener per call, because the listener is removed only in the
resolve path.

To Reproduce

  1. Join a meeting with a presentation on screen.
  2. From a plugin, call pluginApi.getUiData(PresentationWhiteboardUiDataNames.CURRENT_PAGE_SNAPSHOT).
    It resolves normally: 184-310 ms over 14 calls.
  3. Click "Minimize presentation" in the actions bar.
  4. Call it again. The Promise never settles: no resolve, no reject, no console error. Measured as
    nothing after 8000 ms, in 7 of 7 runs.
  5. Restore the presentation. Calls resolve again.

Expected behavior

getUiData always settles. Either it rejects after a timeout when nobody answers, or it resolves
with undefined so the caller can tell "no data" from "still waiting". The window listener should
be removed on that path too, so repeated calls do not pile up.

Actual behavior

The Promise stays pending forever and the listener is never removed. The plugin cannot tell "slow"
from "never", so its loading state stays true indefinitely. The failure is completely silent:
plugin_ui_data_getter_error never fires, because no error ever occurs.

Source: src/ui-data/getters/getters.ts. The Promise is built with resolve only, and
removeEventListener runs inside the response handler.

Screenshots

Not applicable: the failure is a Promise that never settles, with nothing visual on the SDK side.

BBB version, plugin in which The bug happened and SDK version:

  • BigBlueButton Server 3.0.33 (358), built from source at v3.0.x-develop (deb7e66a25)
  • Plugin: bbb-plugin-picture-in-picture, branch v0.0.x (1db1e1c)
  • SDK: bigbluebutton-html-plugin-sdk 0.0.95 (server html5PluginSdkVersion 0.0.105)

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • Browser: Chromium
  • Version: 149.0.7827.55

Smartphone (please complete the following information):

  • Not reproduced on mobile.

Additional context

A plugin can work around this specific case by not calling the getter when the responder is known to
be gone: pluginApi.useUiData(LayoutPresentationAreaUiDataNames.CURRENT_ELEMENT) reports
isOpen: false for the whiteboard while the presentation is minimised, and it keeps working because
it is dispatched from the client's layout context provider rather than from inside the presentation
area. That covers one responder. Any other getter whose responder unmounts hits the same dead end,
which is why the timeout belongs in the SDK.


Reviewed by Guilherme Pereira Leme (@GuiLeme).

Lingua principale
Nessun dato sulla lingua
Stelle
17
Fork
18
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

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 bigbluebutton/bigbluebutton-html-plugin-sdk

Tutte le issue di bigbluebutton/bigbluebutton-html-plugin-sdk

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.