-
Notifications
You must be signed in to change notification settings - Fork 289
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
🪲 Switching to another tab with an ask prompt open, causes the program to mix up #5211
Labels
bug
Something isn't working
Comments
I noticed the same problem when I used |
Yes, that happens because the ask command and the ifpressed command use the same internal mechanism! |
mergify bot
pushed a commit
that referenced
this issue
Mar 12, 2024
In Skulpt there really isn't a way to stop the execution of a program. If the program uses things like prompts for the `input` function, or sleep, then those promises are still somewhere in the JavaScript handler. Therefore, when you execute a new program while another one is still waiting for a promise to be fulfilled (i.e: waiting for user input through an ask prompt), when the new program finishes execution, the old one will continue its path. To fix this I added a new field to `sessionStorage` which will have an id for the program being executed, and I edited Skulpt to pass the id of the program. Therefore, when an old program is being executed, its id will be different than the current one and therefore will finish its execution. Fixes #5211 **How to test** * Go to level 14 and execute the TicTacToe adventure, fill the first ask. * With an ask prompt still open, switch to the Quizmaster tab and execute the program. * Only the Quizmaster program should be executed.
boryanagoncharenko
pushed a commit
that referenced
this issue
Mar 13, 2024
In Skulpt there really isn't a way to stop the execution of a program. If the program uses things like prompts for the `input` function, or sleep, then those promises are still somewhere in the JavaScript handler. Therefore, when you execute a new program while another one is still waiting for a promise to be fulfilled (i.e: waiting for user input through an ask prompt), when the new program finishes execution, the old one will continue its path. To fix this I added a new field to `sessionStorage` which will have an id for the program being executed, and I edited Skulpt to pass the id of the program. Therefore, when an old program is being executed, its id will be different than the current one and therefore will finish its execution. Fixes #5211 **How to test** * Go to level 14 and execute the TicTacToe adventure, fill the first ask. * With an ask prompt still open, switch to the Quizmaster tab and execute the program. * Only the Quizmaster program should be executed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
To reproduce this bug do the following:
The text was updated successfully, but these errors were encountered: