Skip to content

sendReport POST timeout - #4477

Merged
philbogle merged 6 commits into
stagingfrom
ajax_timeout
Oct 13, 2015
Merged

sendReport POST timeout#4477
philbogle merged 6 commits into
stagingfrom
ajax_timeout

Conversation

@philbogle

Copy link
Copy Markdown
Contributor

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.

@philbogle

Copy link
Copy Markdown
Contributor Author

@laurelfan Please take a look.
CC: @mehalshah @wjordan FYI.

@laurelfan

Copy link
Copy Markdown
Contributor

lgtm

philbogle added a commit that referenced this pull request Oct 13, 2015
@philbogle
philbogle merged commit 73b142d into staging Oct 13, 2015

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@davidsbailey
davidsbailey deleted the ajax_timeout branch January 7, 2016 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants