-
Notifications
You must be signed in to change notification settings - Fork 284
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
Stop long running programs in client-side JS #880
Conversation
Hi @fpereiro Seems to work well, but we get a modal and also the regular error box: Not sure if that's what I specified but just the regular error box is fine. As for the text, this is fine, if you just put this in the yaml I can make updates myself. |
Ow and one more thing, if a program also prints, like this:
we first get nothing for 3 secs, then the popup and then all the output. I guess it might not be possible because it might requires threads or the like but could we get all output first and then after 3 secs the popup? |
static/js/app.js
Outdated
__future__: Sk.python3 | ||
__future__: Sk.python3, | ||
// Give up after three seconds of execution, there might be an infinite loop. | ||
execLimit: 3000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put this value in a function that depends on level? For now the function can just be any level returns 3000 but that gives us the flexibility to change it depending on level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you replied to this somewhere (Slack?) but I forgot the answer :) Can you repeat it here?
Hi @Felienne !
|
ok, thanks for the updates! Will try this tomorrow. |
Hi @fpereiro Thanks for the updates! The execution order can be a problem though, it leads to really confusing behavior.
After the first input, it no longer works. So maybe we need to turn the timer off for programs with ask? Also... if you use read loud it gets interesting on your demo program, it reads once, then gives the error and then continues. But I can imagine this all gets too complex and you want to stop working on this request? That is understandable too!! |
@Felienne I found a way to update the timer if there's an
|
Nice, this is almost perfect! There is a small thing, no sure whether we can do something about it but when I enter text, the input box does not disappear until the timeout error message appears. First I thought it had not processed my input. Can that be improved (if not, we can leave it is as) |
HI @Felienne ! Ready to test again :). I added a timeout to ensure that the modal box is hidden before running the program. How to test:
After answering the question, the modal box should go. For three seconds, nothing should happen. Then, after three seconds, an error should be shown. |
No related issue/PR, just a typo fix 🙃 **How to test** Follow these steps to verify this PR works as intended: * _____ (See this #880 (comment) for an example) * _____ **Checklist** Done? Check if you have it all in place using this list: (mark with x if done) - [x] Contains one of the PR categories in the name - [ ] Describes changes in the format above - [ ] Links to an existing issue or discussion - [ ] Has a "How to test" section Not sure the PR template fits simple typo fixes, tell me if you need anything
Please replace all _____ before you create a pull request! Start the name of the PR with one of the relevant prefixes in the title of the PR: * 🖊️ -> changes related to grammars or the transpiler * 🪲 -> solving a bug * 🚚 -> changes unrelated to shipping, such as mergify scripts * 🧹 -> refactorings (changes that do not change functionality and are only a cleanup of code) * 💻 -> improvements and changes of the Hedy website * 🧪 -> changes made to the test suite * 📜 -> changes related to content Fixes _______ (Always link the number of the issue or of the discussion that your PR concerns. If you use the word `fixes` before the issue number in this description, the related issue will automatically close then the PR is merged) **How to test** Follow these steps to verify this PR works as intended: * _____ (See this #880 (comment) for an example) * _____ **Checklist** Done? Check if you have it all in place using this list: (mark with x if done) - [ ] Contains one of the PR categories in the name - [ ] Describes changes in the format above - [ ] Links to an existing issue or discussion - [ ] Has a "How to test" section If you're unsure about any of these, don't hesitate to ask. We're here to help!
How to test:
@Felienne suggestions to the shown text are welcome! Once we agree on the text, I can add the text entry to the yamls.