online-go / online-go.com

Source code for the Online-Go.com web interface
https://online-go.com/
GNU Affero General Public License v3.0
1.23k stars 345 forks source link

Countdown audio does not play in analysis mode #1505

Closed RubyMineshaft closed 1 year ago

RubyMineshaft commented 3 years ago

Describe the bug The countdown audio does not play when the game is in analysis mode, causing some users to time out.

Expected behavior Sounds should still play in analysis mode

RubyMineshaft commented 3 years ago

I took a quick look around in the game view code, but nothing immediately stood out to me. I'll take a closer look when I have more time unless someone has an idea what could be causing it.

shinuito commented 3 years ago

There's some other funny instances, where for example the stone sound won't play when you navigate back a few moves into a variation and then play a new stone.

I wonder could it be related.

mmartin commented 3 years ago

I think it's because of these lines:

// check if we need to update our audio
if (this.mode === 'play' && this.engine.phase === 'play') {

https://github.com/online-go/goban/blob/main/src/GobanCore.ts#L2909

Somewhere around there is also the reason why countdown does not work properly with submit-move.

anoek commented 1 year ago

Fixed in https://github.com/online-go/goban/commit/63c2db6bddcdfa891e554a0e4ff793273e3b16f9