As I elaborated in #1, this approach is easy to use for the developer but breaks UX for users that were in the middle of a scene when it gets slightly updated and the step positions shift. If we store step names instead of positions that will be much more reliable (and we could even allow developers to add optional fallback steps for legacy users).
[x] every wait() call must accept label, such as wait("name")
[x] call() must only allowed to be made ~from within a labelled step~ when the next step (a return point) is labeled
[x] prevent adding two labels for a single step to prevent ambiguity when discovering current step name
[x] recognize old session format for backwards compatibility
Currently, the stack frame stores the position of the step which called
wait()
:https://github.com/IlyaSemenov/grammy-scenes/blob/84a1082d43441a2cebdc8b85bfb09facc49e681e/src/types.ts#L12-L17
https://github.com/IlyaSemenov/grammy-scenes/blob/84a1082d43441a2cebdc8b85bfb09facc49e681e/src/scenes_manager.ts#L118-L121
As I elaborated in #1, this approach is easy to use for the developer but breaks UX for users that were in the middle of a scene when it gets slightly updated and the step positions shift. If we store step names instead of positions that will be much more reliable (and we could even allow developers to add optional fallback steps for legacy users).
wait()
call must accept label, such aswait("name")
call()
must only allowed to be made ~from within a labelled step~ when the next step (a return point) is labeled