lichess-org / lila

♞ lichess.org: the forever free, adless and open source chess server ♞
https://lichess.org
GNU Affero General Public License v3.0
15.69k stars 2.28k forks source link

Interactive lesson inconsistent state #15808

Closed Siderite closed 2 months ago

Siderite commented 3 months ago

Exact URL of where the bug happened

https://lichess.org/study/TA3t1HLK/f8o2kJYW

Steps to reproduce the bug

  1. play the interactive first chapter till the end
  2. at the end press Analysis Board
  3. press Analysis Board to play the chapter again
  4. make a wrong move

What did you expect to happen?

no errors

What happened instead?

error trying to read the "deviation" property of the first node's gamebook, which does not exist.

Operating system

Windows 11

Browser and version (or alternate access method)

Brave

Additional information

Offending line is here: https://github.com/lichess-org/lila/blob/d6815dadd30b16da80a3a6bc27f3095c9f3678a4/ui/analyse/src/study/gamebook/gamebookPlayCtrl.ts#L57

Details:

AbdoAlghanim commented 3 months ago

Shouldn't the offending line be something that relates to the Analysis Button's logic instead? It all works seamlessly until the Analysis Button switches gamebooks.

E27183 commented 2 months ago

Extra information:

This bug can be reproduced in any interactive study whenever there is no content in the text box under "When any other wrong move is played:" for the step where the wrong move is played. But if there is content in this text box it works with no errors.