Opened 12 years ago
Closed 12 years ago
#24758 closed defect (bug) (fixed)
Revisions needs to gracefully handle AJAX failures.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | 3.6 |
Component: | Revisions | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Currently we just leave the spinner going.
Attachments (10)
Change History (22)
#2
@
12 years ago
Related, #24757. Me: "Perhaps if the request times out, errors out, or takes more than X seconds, we need to cut in half the number of revisions we just tried to request."
#3
@
12 years ago
24758.2.diff implements Nacin's suggestion. on .fail()
, it cuts the number in half. I tested this by setting the AJAX callback to fail if the number of requested comparisons was greater than 5. It cut down from 40 to 20, then 20 to 10, then 10 to 5, which worked, so it did the rest of them by 5. Nice.
#4
@
12 years ago
24758.3.diff makes sane the promise attempt.
#5
@
12 years ago
To test this, I simply produced a fatal error in wp_ajax_get_revision_diffs
. On a post with 200 revisions the number goes down: 20, 10, 5, 3, 2, 1. Works so far. But I didn't get the error message and it still hammers the server with a request. Shouldn't we stop after X failed request?
#7
@
12 years ago
24758.5.diff stops after one, and properly displays the error message. Tested with a fatal error in wp_ajax_get_revision_diffs()
.
#8
follow-up:
↓ 9
@
12 years ago
The error message is not displayed on first load. But requests stop.
#9
in reply to:
↑ 8
@
12 years ago
Replying to ocean90:
The error message is not displayed on first load. But requests stop.
the first diff is now preloaded in php so you will never see an error on first load. i set up a random error in wp_ajax_get_revision_diffs() and tested, with 24758.6.diff i do see the error message briefly, until the ajax re-fires and loads correctly. i also observed the number of diffs bundled per request reducing to 1 and then giving up on further requests.
looks good!
Simple error message.