Opened 5 years ago
Last modified 7 weeks ago
#55368 reopened defect (bug)
Handle ajax failure when doing actions on themes/plugins
| Reported by: | mirkolofio | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Administration | Version: | 5.9.2 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: | javascript, administration, ui-copy |
Description
When maintenance mode is active or the server is unresponsive for any reason, there are some ui issues in ajax-related messages like:
- When trying to delete a plugin: "Deleting..." forever. No error shown.
- When trying to enable auto-updates on a plugin: "Enabling..." forever. "The request could not be completed" error is shown. Same for disabling.
- When trying to delete a theme: "Deletion failed: undefined" error shown.
- When trying to enable a theme: "Enabling..." forever. "The request could not be completed." error shown. Same for disabling.
Check the screenshots attached below.
I tried to stay short in title description but I'm not sure it's 100% clear.
Attachments (4)
Change History (12)
#1
in reply to: ↑ description
@
5 years ago
- When trying to delete a plugin: "Deleting..." forever. No error shown.
There an error there: "Deletion failed: Briefly unavailable for scheduled maintenance. Check back in a minute."
It's on the top of the page, I missed it.
#2
@
5 years ago
- Resolution → invalid
- Status new → closed
Hello there, welcome to WordPress's trac! Thanks for the report, this seems to be an expected behavior.
If you think I'm wrong feel free to reopen the ticket and may be explain more deeply what's the bug.
Thanks.
#3
@
5 years ago
- Resolution invalid
- Status closed → reopened
Reopening this. It's not expected at all, let me better explain.
Example on Plugin enable auto-updates failure
Current behaviour:
- Button switched to "Deleting..." forever
- Error message shown: "The request could not be completed"
Expected behavior:
- Button switched to "Deleting..."
- Error message should be: "The request could not be completed. Please retry."
- The button should be switched back to "Delete"
Another example on Theme delete failure
Current behaviour:
- Error message shown "Deletion failed: undefined"
Expected behaviour:
- At least we don't want to show "undefined" for sure.
And so on...
#4
@
5 years ago
Since maintenance is frequently due to a plugin/theme/core update in progress and it's usually a matter of seconds, the messages should be clear enough to permit the user to retry just a second later.
Please not that if you click on the "Deleting..." button once again it works, it's not a matter of feature though, it's just some bad/confusing UI/UX.
#6
@
15 months ago
- Keywords needs-patch added
Suggestion in Comment #3 above to add an action that suggests the user either try the action again, or potentially restart their server, seems reasonable.
This ticket was mentioned in PR #12654 on WordPress/wordpress-develop by @arkaprabhachowdhury.
3 months ago
#7
- Keywords has-patch has-unit-tests added; needs-patch removed
## What changed
- Restore plugin and theme deletion controls when an Ajax request fails.
- Avoid showing an undefined theme deletion error for invalid responses.
- Restore auto-update toggle labels after failed requests and suggest retrying.
- Add focused QUnit coverage for maintenance-mode and network failure responses.
## Why
Plugin and theme actions can receive an invalid response while maintenance mode is active or when the server is unavailable. The existing handlers could leave controls displaying a permanent loading state or expose undefined as the error message.
## Testing
grunt jshint:core --file=wp/updates.jsgrunt jshint:testsnpm run typecheck:js- QUnit source mode: 541/541 passed
- QUnit compiled mode: 541/541 passed
#8
@
7 weeks ago
Opened [PR #12654](https://github.com/WordPress/wordpress-develop/pull/12654) to address this ticket. What changed - Restore plugin and theme deletion controls when an Ajax request fails. - Avoid showing an undefined theme deletion error for invalid responses. - Restore auto-update toggle labels after failed requests and suggest retrying. - Add focused QUnit coverage for maintenance-mode and network failure responses. Why Plugin and theme actions can receive an invalid response while maintenance mode is active or when the server is unavailable. The existing handlers could leave controls displayi The PR includes focused regression coverage, and its validation details are recorded in the PR description.
I picked this up because the ticket describes a concrete core behavior or edge case that remains relevant in current WordPress. The proposed change is intentionally scoped to the ticket and is submitted here for code review, with the technical discussion remaining on this ticket.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Plugin delete failure