Closed Nancy-Salpepi closed 1 year ago
When looking into this with Nancy, I hadn't updated to the newest version of chrome yet, was still on 108.0.5359.125 and this behavior did not occur. I then updated to latest and the alerts were interrupted. This was consistent on mac and windows.
Thanks for the report. I confirmed it is not happening in Version 108.0.5359.125 (Official Build) (64-bit). And it is happening in Version 109.0.5414.75 (Official Build) (64-bit).
@stemilymill also confirmed that it doesn't happen in published sims.
It is an issue for published ratio-and-proportion but not gravity-force-lab-basics. I suspect something from https://github.com/phetsims/utterance-queue/issues/97 may not be compatible with latest Chrome, but its just a guess.
Sorry--we only tested published GFLB and JT! Forgot about RaP!
No worries! Only thought to check because it was published recently. If it wasn't there we would know the problem was introduced in the last two weeks.
I am going to transfer to joist, it seems specific to these buttons and is now a common code problem.
It is caused by this line:
So the order of events has changed when you press the second button.
I should note this is happening in master and published RaP but NOT in older sims. That made me suspect https://github.com/phetsims/utterance-queue/issues/97, but commenting out those changes did nothing.
When I comment out this line, the problem goes away:
And that matches this bug showing up in a platform update, I could see Chrome starting to fire BOTH the error
and cancel
event for some reason.
EDIT:
I noticed that we were never removing the error
listener. We should be, so I added this line. It fixed the problem!! But I don't know why. To be continued tomorrow.
Index: js/SpeechSynthesisAnnouncer.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/SpeechSynthesisAnnouncer.ts b/js/SpeechSynthesisAnnouncer.ts
--- a/js/SpeechSynthesisAnnouncer.ts (revision 1c2007a9c3b1123ebba1ca2014ac0a72b76ba314)
+++ b/js/SpeechSynthesisAnnouncer.ts (date 1673566796120)
@@ -647,6 +647,7 @@
this.endSpeakingEmitter.emit( stringToSpeak, speechSynthesisUtteranceWrapper.utterance );
this.announcementCompleteEmitter.emit( speechSynthesisUtteranceWrapper.utterance, speechSynthesisUtteranceWrapper.speechSynthesisUtterance.text );
+ speechSynthesisUtteranceWrapper.speechSynthesisUtterance.removeEventListener( 'error', speechSynthesisUtteranceWrapper.endListener );
speechSynthesisUtteranceWrapper.speechSynthesisUtterance.removeEventListener( 'end', speechSynthesisUtteranceWrapper.endListener );
speechSynthesisUtteranceWrapper.speechSynthesisUtterance.removeEventListener( 'start', speechSynthesisUtteranceWrapper.startListener );
Here is some logging output from the buggy case demonstrating why not removing the error event listener is a problem. Logging starts after pressing the second button:
This shows that the error
event for the first SpeechSynthesisUtterance
happened asynchronously and after the second Utterance
had been added to the UtteranceQueue
.
So removing the error
listener definitely fixes this problem.
@Nancy-Salpepi can you please confirm that this is fixed in master?
it is indeed fixed @jessegreenberg
Great, thanks! Closing.
Test device MacBook Air (m1 chip)
Operating System 13.1
Browser Chrome Version 109.0.5414.87
Problem description For https://github.com/phetsims/qa/issues/879, on the newest version of chrome (109....) Quick Info alerts will not play when interrupted.
Steps to reproduce
I didn't see this issue on published GFLB and JT. When I tried GFLB on master, it happened there as well.
Visuals
https://user-images.githubusercontent.com/87318828/212174873-95fb45f7-446c-4094-9e48-a3c92ec9b88f.mov