ShockwaveGraph: handle state transition properly

Quite ugly, I will see if I can do better