phetsims / utterance-queue

Alerting library powered by aria-live
MIT License
0 stars 2 forks source link

Listener order dependency with two UtteranceQueues sharing an Announcer #49

Open jessegreenberg opened 2 years ago

jessegreenberg commented 2 years ago

If you share an Announcer between two UtteranceQueues and an UtteranceQueue doesn't empty it is is possible that the second UtteranceQueue will never get to announce because the Announcer is used up (never readyToSpeak ) by the first UtteranceQueue.

UtteranceQueues are stepped, and the order that they are stepped is determined by stepTimer listener order (i.e. order of UtteranceQueue creation). If the first UtteranceQueue in listener order always has Utterances, the second one may never speak.

jessegreenberg commented 2 years ago

Lets make a test that fails for it. But this also feels like it is unlikely to happen in the wild, so it is probably not very high priority.

@zepumph offered to create a test case for this, thanks!