Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store step name instead of position #13

Closed
4 tasks done
IlyaSemenov opened this issue Apr 30, 2023 · 1 comment
Closed
4 tasks done

Store step name instead of position #13

IlyaSemenov opened this issue Apr 30, 2023 · 1 comment
Labels

Comments

@IlyaSemenov
Copy link
Owner

IlyaSemenov commented Apr 30, 2023

Currently, the stack frame stores the position of the step which called wait():

export interface SceneStackFrame {
scene: string
pos: number
context?: any
token?: string
}

} else if (scene_manager._want_wait) {
// FIXME: need to save named position here.
frame.pos++
this.ctx.session.scenes ??= { stack }

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).

  • every wait() call must accept label, such as wait("name")
  • call() must only allowed to be made from within a labelled step when the next step (a return point) is labeled
  • prevent adding two labels for a single step to prevent ambiguity when discovering current step name
  • recognize old session format for backwards compatibility
@github-actions
Copy link

🎉 This issue has been resolved in version 10.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant