Skip to content

Interactive lesson inconsistent state #15808

@Siderite

Description

@Siderite

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:

state.comment = parNode.children[0].gamebook!.deviation;

Details:

  • when first playing the chapter, the nodes all have a "gamebook" property, filled with an empty object
  • make a wrong move and the move is added as a node to the tree, without a gamebook property
  • going to Analysis Board doesn't change that
  • pressing the Analysis Board button again REVERSES the situation: the good move does not have a gamebook and the bad move does
  • now any wrong move will attempt to read the deviation of the first node's gamebook which now does not exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueNarrow in scope (but not necessarily easy)

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions