Terminated ajax requests throw error even if terminated because of a form submit

Created on 7 July 2017, almost 7 years ago
Updated 2 November 2023, 8 months ago

Problem/Motivation

There was a similar thread for D7 - #2808789: Fix "An AJAX HTTP request terminated abnormally" alert after user has navigated away from the page β†’ .

The problem we are experiencing is mostly in JS functional tests having the autosave_form module enabled where ajax request are triggered at a specific interval but the form is submitted before an ajax request has finished, in which case the ajax request is terminated and drupal is throwing a JS error, at which point phantomjs will interrupt the test and exit with an error.

Proposed resolution

Do not throw the error if the response has the status code 0 and the unbeforeunload event has been triggered.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
AjaxΒ  β†’

Last updated 2 days ago

Created by

πŸ‡©πŸ‡ͺGermany hchonov πŸ‡ͺπŸ‡ΊπŸ‡©πŸ‡ͺπŸ‡§πŸ‡¬

Live updates comments and jobs are added and updated live.
  • Contributed project blocker

    It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024