sendReport POST timeout - #4477
Conversation
…-org/code-dot-org into specify_path_in_cookies
|
@laurelfan Please take a look. |
|
lgtm |
There was a problem hiding this comment.
In practice, a 4 second timeout seems very aggressive. I'd expect something closer to 15 seconds to deal with real-world network latencies on slow networks (3G, LTE for mobile devices).
I recognize that we don't require the response, but it does slightly change the user experience as we discussed (for things like hints, earning trophies, hitting the end of a stage, etc.) So, I think it would be better if we waited a little longer.
There was a problem hiding this comment.
Thanks for that suggestion. I will send out a PR bumping up the time.
15 seconds is a very long time for users to wait, hope that is not the
common case!
On Tue, Oct 13, 2015 at 7:31 PM, Chris Pirich notifications@github.com
wrote:
In dashboard/app/assets/javascripts/sendReport.js
#4477 (comment)
:@@ -41,6 +47,9 @@ var sendReport = function(report) {
type: 'POST',
url: report.callback,
contentType: 'application/x-www-form-urlencoded',
- // Set a timeout of a few seconds so the user will get the fallback
- // response even if the server is hung and unresponsive.
- timeout: 4000,
In practice, a 4 second timeout seems very aggressive. I'd expect
something closer to 15 seconds to deal with real-world network latencies on
slow networks (3G, LTE for mobile devices)—
Reply to this email directly or view it on GitHub
https://github.com/code-dot-org/code-dot-org/pull/4477/files#r41949629.
Add a timeout to the Ajax request in sendReport so that the user can advance to the next level even if the server is so oveloaded it can't deliver a response in a reasonable time.