-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Fixes skip faulty warning being shown (#4564)
**Description** When the server takes too long to respond to a `/parse` request, the front-end assumes that this must be because it is recompiling the program after finding errors, due to this code in `app.ts` ``` let errorsFoundTimeout = setTimeout(function () { error.showWarningSpinner(); error.showWarning(ClientMessages['Execute_error'], ClientMessages['Errors_found']); }, 500) let response = await postJsonWithAchievements('/parse', data); clearTimeout(errorsFoundTimeout); error.hide() ``` This essentially means: wait for 500 ms for response, if it answers before you don't execute the function and hides any possible errors. I changed that and now we only show the warning box if we find errors we skipped in the source map. This means that we are not relying on the response time of the server, and will reliably show the warning. I changed also the wording of the warning and now it says this: "You made a mistake! Don't worry, we still ran the program". However, @Felienne can you tell me if this is a good wording, I'm not sure this is clear enough. **How to test** Easiest way to reproduce is: 1. add a sleep to `/parse` endpoint 2. See that now even if the server takes long to respond the skip faulty error is not shown Depends-On: #4560
- Loading branch information
Showing
6 changed files
with
41 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ CheckInternet: "Have a look if your Internet connection is working properly." | |
ServerError: "You wrote a program we weren't expecting. If you want to help, send us an email with the level and your program at [email protected]. In the meantime, try something a little different and take another look at the examples. Thanks!" | ||
Program_too_long: "Your program takes too long to run." | ||
Program_repair: "This could be the correct code, can you fix it?" | ||
Errors_found: "You made a mistake! Don't worry, Hedy is trying to find the mistakes" | ||
Errors_found: "You made a mistake! Don't worry, we still ran the program" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters