Skip to content
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

Show custom alert for 504 error from nginx #1052

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

matthew-white
Copy link
Member

We know that it's possible for users to receive a 504 response from nginx if the request takes too long (more than 2 minutes). We've seen this most recently at getodk/central#171 (comment), but it's also come up in the past. Right now, a user who receives a 504 will just see, "Something went wrong: error code 504." The goal of this PR is to show a nicer error message instead. The user may still need to contact us for assistance, but at least they won't need to look up what a 504 is.

What has been done to verify that this works as intended?

New unit test.

Why is this the best possible solution? Were any other approaches considered?

I proposed the new error text as part of the discussion at getodk/central#171.

Before submitting this PR, please make sure you have:

  • run npm run test and npm run lint and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

@matthew-white matthew-white self-assigned this Nov 14, 2024
@@ -441,8 +441,7 @@
"mixin": {
"request": {
"alert": {
"fileSize": "The file “{name}” that you are trying to upload is larger than the 100 MB limit.",
"entityTooLarge": "The data that you are trying to upload is too large.",
"fileSize": "The file “{name}” that you are trying to upload is larger than the 100 MB limit."
Copy link
Member Author

Choose a reason for hiding this comment

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

This message is not used in src/util/request.js, so I'm leaving it where it is for now. I think it's very likely that we'll move it at some point in the future (probably as part of #675).

"error": {
// @transifexKey mixin.request.alert.entityTooLarge
"413": "The data that you are trying to upload is too large.",
"504": "Your request took too long, and Central stopped waiting for it."
Copy link
Member Author

Choose a reason for hiding this comment

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

@lognaturel @alyblenkin, let me know if you can think of a better message to show to users.

Copy link
Member Author

Choose a reason for hiding this comment

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

(Just for the 504, we've already shipped the message for the 413.)

Choose a reason for hiding this comment

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

Why did it take too long? Can they do anything to prevent it from timing out?

I don't think we need to say and "Central stopped waiting" because it seems like we gave up :)

We could say "Your request took too long because X. Try again."

Copy link
Member

Choose a reason for hiding this comment

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

Really good to get your feedback, @alyblenkin! I do think "why did you give up?!" is a likely reaction to that message. I think most users of websites have never thought about the idea that there has to be some processing time cutoff or the service could get stuck forever.

Who is the improved message aimed at? What action do we want them to take?

One idea is to aim it at end users and to get them to contact us. "The latest action you attempted timed out. Please contact [email protected] with a description of what you were doing."

Another is to aim it at server admins and give them the idea that they could adjust the timeout. "The latest action exceeded the configured nginx timeout."

Maybe a hybrid? "The latest action exceeded the configured nginx timeout. Please contact [email protected] with a description of what you were doing."

That gives admins a clue of an action they could take today. It also encourages frustrated users to give us more info on when this happens.

Choose a reason for hiding this comment

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

I like "The latest action you attempted timed out. Please contact [email protected] with a description of what you were doing" because it’s actionable and user-friendly! From a non-technical perspective, "configured nginx" might require some Googling, so perhaps sticking with the first option is better unless you think server admins would immediately understand what's happening?

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds good to me as well!

This is a small thing, but would the message read alright without the word "latest"? On some pages, it's possible for the user to take multiple actions at once. I don't think this is the most likely thing, but it's within the realm of possibility that an earlier action was the one to result in the error, while the latest action was successful.

Choose a reason for hiding this comment

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

Ah that's an interesting point. So maybe something like:

Your action could not be completed because it timed out. If this issue continues happening, please contact [email protected] with a description of what you were doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🕒 backlog
Development

Successfully merging this pull request may close these issues.

3 participants