Page MenuHomePhabricator

Allow for retrying timed out requests in GrowthTasksApi
Open, LowPublicPRODUCTION ERROR

Description

Original production error report is at the end.

Occasionally, API requests made via GrowthTasksApi will timeout. This would include:

  • fetching new tasks for Suggested Edits module on Special:Homepage during queue navigation
  • updating the task queue as task/topic filters are modified
  • fetching tasks to display in the post-edit dialog
  • fetching tasks for the post-edit dialog when navigating through the queue

For those scenarios, we'd like to offer a dialog to the user informing them that the request timed out, with a button to allow for retrying the request.

image.png (366×652 px, 35 KB)

At the same time, we also want to lower the timeout limit to 15 seconds (default is 30).


Error
normalized_message
timeout
exception.trace
at GrowthTasksApi.handleError  https://ja.wikipedia.org/w/load.php?lang=ja&modules=ext.growthExperiments.Homepage.Impact%2CLogger%2CLogging%2CStartEditing%2CSuggestedEdits%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%7Cmediawiki.router&skin=vector&version=1dgvg:130:217
at mightThrow  https://ja.wikipedia.org/w/load.php?lang=ja&modules=ext.growthExperiments.Homepage.Impact%2CLogger%2CLogging%2CStartEditing%2CSuggestedEdits%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%7Cmediawiki.router&skin=vector&version=1dgvg:215:833
at process  https://ja.wikipedia.org/w/load.php?lang=ja&modules=ext.growthExperiments.Homepage.Impact%2CLogger%2CLogging%2CStartEditing%2CSuggestedEdits%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%7Cmediawiki.router&skin=vector&version=1dgvg:216:498
Impact

132 occurrences in the last month (last seen on Nov 15, 2021 @ 09:01:28.145 )

Event Timeline

Krinkle renamed this task from timeout to timeout in GrowthTasksApi.handleError.Dec 2 2021, 12:05 AM
Krinkle moved this task from Untriaged to Nov 2021 on the Wikimedia-production-error board.

I'm not sure that there is anything to do here? Sometimes requests time out. I suppose we could present a message to the user that this is happening with a prompt to retry the request (the request is to fetch suggested edits tasks, usually) and not log the error? @RHo what do you think?

I'm not sure that there is anything to do here? Sometimes requests time out. I suppose we could present a message to the user that this is happening with a prompt to retry the request (the request is to fetch suggested edits tasks, usually) and not log the error? @RHo what do you think?

I might need a little more context but I'm firstly curious if we know on average how long before it times out? If it was 20-30sec then an error message and retry action definitely makes sense, but would not want it to be much longer than that. If it was 2min then pretty sure that person already closed the window and perhaps we could look at introducing some other indicator like progress or messaging to let the person know that something is still being fetched until it fails.

I'm not sure that there is anything to do here? Sometimes requests time out. I suppose we could present a message to the user that this is happening with a prompt to retry the request (the request is to fetch suggested edits tasks, usually) and not log the error? @RHo what do you think?

I might need a little more context but I'm firstly curious if we know on average how long before it times out? If it was 20-30sec then an error message and retry action definitely makes sense, but would not want it to be much longer than that. If it was 2min then pretty sure that person already closed the window and perhaps we could look at introducing some other indicator like progress or messaging to let the person know that something is still being fetched until it fails.

@RHo we're using MediaWiki's API helper class, which sets a default value of 30 seconds for the XMLHttpRequest timeout value. We could lower or raise that number. Maybe something like 10 seconds is closer to the upper limit of what users would tolerate, so if the request hasn't finished by then, we should offer that they can manually retry it.

In terms of how the user might be impacted by timeouts, a few scenarios are:

  • when interacting with topic/task filter dialogs, and waiting a long time to see the result counter change. We have a spinner showing that something is happening. Closing the dialog and reopening is a way to restart the query now, as is adjusting the topic/task selections.
  • when waiting for a task to appear in the post-edit dialog.
  • after clicking "next" on the first task in the suggested edits feed. The first one is rendered on the server-side, but after that we begin to fetch tasks from a client side API call. We could probably rework the code to not require an API request for initial browsing of the queue, since we have 20 tasks already.

I'm not sure that there is anything to do here? Sometimes requests time out. I suppose we could present a message to the user that this is happening with a prompt to retry the request (the request is to fetch suggested edits tasks, usually) and not log the error? @RHo what do you think?

I might need a little more context but I'm firstly curious if we know on average how long before it times out? If it was 20-30sec then an error message and retry action definitely makes sense, but would not want it to be much longer than that. If it was 2min then pretty sure that person already closed the window and perhaps we could look at introducing some other indicator like progress or messaging to let the person know that something is still being fetched until it fails.

@RHo we're using MediaWiki's API helper class, which sets a default value of 30 seconds for the XMLHttpRequest timeout value. We could lower or raise that number. Maybe something like 10 seconds is closer to the upper limit of what users would tolerate, so if the request hasn't finished by then, we should offer that they can manually retry it.

Yes, maybe 15seconds (to split the difference) before there is a dialog or message with an action to retry?

In terms of how the user might be impacted by timeouts, a few scenarios are:

  • when interacting with topic/task filter dialogs, and waiting a long time to see the result counter change. We have a spinner showing that something is happening. Closing the dialog and reopening is a way to restart the query now, as is adjusting the topic/task selections.
  • This seems sufficient to me.
  • when waiting for a task to appear in the post-edit dialog.
  • after clicking "next" on the first task in the suggested edits feed. The first one is rendered on the server-side, but after that we begin to fetch tasks from a client side API call. We could probably rework the code to not require an API request for initial browsing of the queue, since we have 20 tasks already.
  • Yes, that would be great.

I'm not sure that there is anything to do here? Sometimes requests time out. I suppose we could present a message to the user that this is happening with a prompt to retry the request (the request is to fetch suggested edits tasks, usually) and not log the error? @RHo what do you think?

I might need a little more context but I'm firstly curious if we know on average how long before it times out? If it was 20-30sec then an error message and retry action definitely makes sense, but would not want it to be much longer than that. If it was 2min then pretty sure that person already closed the window and perhaps we could look at introducing some other indicator like progress or messaging to let the person know that something is still being fetched until it fails.

@RHo we're using MediaWiki's API helper class, which sets a default value of 30 seconds for the XMLHttpRequest timeout value. We could lower or raise that number. Maybe something like 10 seconds is closer to the upper limit of what users would tolerate, so if the request hasn't finished by then, we should offer that they can manually retry it.

Yes, maybe 15seconds (to split the difference) before there is a dialog or message with an action to retry?

That sounds good to me; I think the next step would be to think about what the UX would look like (a popup dialog with a button to retry, like VisualEditor has?), and what the wording should be. And it should probably be instrumented as well.

In terms of how the user might be impacted by timeouts, a few scenarios are:

  • when interacting with topic/task filter dialogs, and waiting a long time to see the result counter change. We have a spinner showing that something is happening. Closing the dialog and reopening is a way to restart the query now, as is adjusting the topic/task selections.
  • This seems sufficient to me.

+1

  • when waiting for a task to appear in the post-edit dialog.

Ah, great. Thanks!

  • after clicking "next" on the first task in the suggested edits feed. The first one is rendered on the server-side, but after that we begin to fetch tasks from a client side API call. We could probably rework the code to not require an API request for initial browsing of the queue, since we have 20 tasks already.
  • Yes, that would be great.

I started experimenting with this in T308542: Suggested edits: Populate task queue from server-side.

@RHo we're using MediaWiki's API helper class, which sets a default value of 30 seconds for the XMLHttpRequest timeout value. We could lower or raise that number. Maybe something like 10 seconds is closer to the upper limit of what users would tolerate, so if the request hasn't finished by then, we should offer that they can manually retry it.

Yes, maybe 15seconds (to split the difference) before there is a dialog or message with an action to retry?

That sounds good to me; I think the next step would be to think about what the UX would look like (a popup dialog with a button to retry, like VisualEditor has?), and what the wording should be. And it should probably be instrumented as well.

How about something like this:

image.png (368×670 px, 35 KB)

It uses the OOUI name | Message dialog (2 actions)]] and I was thinking the following message copy:
Heading: Request timed out
Text: The request took too long to respond. Would you like to retry?
Primary (progressive) CTA button label: Try again

@RHo we're using MediaWiki's API helper class, which sets a default value of 30 seconds for the XMLHttpRequest timeout value. We could lower or raise that number. Maybe something like 10 seconds is closer to the upper limit of what users would tolerate, so if the request hasn't finished by then, we should offer that they can manually retry it.

Yes, maybe 15seconds (to split the difference) before there is a dialog or message with an action to retry?

That sounds good to me; I think the next step would be to think about what the UX would look like (a popup dialog with a button to retry, like VisualEditor has?), and what the wording should be. And it should probably be instrumented as well.

How about something like this:

image.png (368×670 px, 35 KB)

It uses the OOUI name | Message dialog (2 actions)]] and I was thinking the following message copy:
Heading: Request timed out
Text: The request took too long to respond. Would you like to retry?
Primary (progressive) CTA button label: Try again

That looks good to me, though I'd suggest a minor change on the wording to: The request took too long to complete. Would you like to retry?

@RHo we're using MediaWiki's API helper class, which sets a default value of 30 seconds for the XMLHttpRequest timeout value. We could lower or raise that number. Maybe something like 10 seconds is closer to the upper limit of what users would tolerate, so if the request hasn't finished by then, we should offer that they can manually retry it.

Yes, maybe 15seconds (to split the difference) before there is a dialog or message with an action to retry?

That sounds good to me; I think the next step would be to think about what the UX would look like (a popup dialog with a button to retry, like VisualEditor has?), and what the wording should be. And it should probably be instrumented as well.

How about something like this:

image.png (368×670 px, 35 KB)

It uses the OOUI name | Message dialog (2 actions)]] and I was thinking the following message copy:
Heading: Request timed out
Text: The request took too long to respond. Would you like to retry?
Primary (progressive) CTA button label: Try again

That looks good to me, though I'd suggest a minor change on the wording to: The request took too long to complete. Would you like to retry?

Sure, SGTM!

image.png (366×652 px, 35 KB)

kostajh renamed this task from timeout in GrowthTasksApi.handleError to Allow for retrying timed out requests in GrowthTasksApi.Jun 1 2022, 8:47 AM
kostajh triaged this task as Low priority.
kostajh updated the task description. (Show Details)
kostajh updated the task description. (Show Details)

@RHo based on https://www.nngroup.com/articles/response-times-3-important-limits/, I wonder if we should consider a lower timeout limit, like 5 or 10 seconds.