xstate-viz icon indicating copy to clipboard operation
xstate-viz copied to clipboard

Bug in stately.ai/viz

Open IgnusG opened this issue 4 years ago • 3 comments

First of all a disclaimer

Really sorry if this is the wrong repository. I cannot find any reference to bug tracking or other contact information on the stately.ai website so I followed it here through links. I feel like it's a closed-source continuation/sister of this project?

If this is the wrong project I'd be grateful if you could point me to the right repository or similar and apologies for the noise on this issue board 😅

The issue

Rendering problem with the following state machine:

State machine code
createMachine({
  id: "loginProcess",
  initial: "welcome",
  states: {
    welcome: {
      on: {
        LOGIN: { target: "login" },
        REGISTER: { target: "register" },
      },
    },
    login: {
      initial: "normal",
      states: {
        normal: {
          on: {
            LOGIN_INCORRECT: { target: "incorrectTry" },
          },
        },
        incorrectTry: {
          on: {
            LOGIN_INCORRECT: { target: "" },
          },
        },
        alreadyRegistered: {
          on: {
            LOGIN_INCORRECT: { target: "incorrectTry" },
          },
        },
      },
      after: {
        300e3: { target: "welcome" },
      },
      on: {
        LOGIN_SUCCESSFUL: { target: "loggedIn" },
        FORGOT_PASSWORD: { target: "forgotPassword" },
      },
    },
    forgotPassword: {
      type: "final",
    },
    register: {
      on: {
        ALREADY_REGISTERED: { target: "login.alreadyRegistered" },
        REGISTRATION_SUCCESSFUL: { target: "loggedIn" },
      },
    },
    loggedIn: {
      type: "final",
    },
  },
});

A wild arrow seems to appear not leading to the right block:

image

IgnusG avatar Aug 31 '21 19:08 IgnusG

This is the right place, thanks for the report! That is indeed strange; we'll investigate 🔎

davidkpiano avatar Aug 31 '21 19:08 davidkpiano

Are there any updates on this? I have the same issue withy my machine viz since I introduced substates. I can't really figure out what the problem seems to be. I played around with the machine mentioned above and got two wrong arrows by changing the welcome state to welcome: { on: { LOGIN: { target: "login" }, REGISTER: { target: "forgotPassword" }, }, }, Any help is appreciated

JonasMa avatar Oct 22 '21 07:10 JonasMa

I am facing the same issue

nirajhx avatar Jan 19 '22 10:01 nirajhx