Problem/Motivation
Discovered while working on #3253158: Add Alpha level Experimental Automatic Updates module. We have functional tests for our updates via the form that use the batch system. We test that if there are exception in the process they are shown.
There seems to be 2 problems going on that are demonstrated in the tests that ran on the patch on #9
- In 10.0.x both the Functional and FunctionalJavascript tests pass. So the functionality works with both non-js and js users
- In 10.1.x the Functional tests pass but the FunctionalJavascript does not pass.
When testing this manually with a browser that has javascript enabled(unlike the functional test).
There is javascript errorUncaught TypeError: Cannot read properties of null (reading 'removeAttribute')
at Drupal.Message.defaultWrapper (message.js?v=11.0-dev:43:17)
at new Drupal.Message (message.js?v=11.0-dev:26:46)
at new Drupal.AjaxError (ajax.js?v=11.0-dev:184:35)
at Object.error (progress.js?v=11.0-dev:157:25)
at c (jquery.min.js?v=3.7.0:2:25266)
at Object.fireWith [as rejectWith] (jquery.min.js?v=3.7.0:2:26015)
at l (jquery.min.js?v=3.7.0:2:77746)
at XMLHttpRequest. (jquery.min.js?v=3.7.0:2:80204)Here is the lines
wrapper = document.querySelector('[data-drupal-messages-fallback]'); wrapper.removeAttribute('data-drupal-messages-fallback'); wrapper.setAttribute('data-drupal-messages', ''); wrapper.classList.remove('hidden');
so it appears
document.querySelector('[data-drupal-messages-fallback]');
does not return a result. -
On 11.x both tests fail.
When testing with Javascript disabled
on it appears to briefly so the progress and then a white screen
Proposed resolution
The functional JavaScript test's failure has a different cause than the functional test's failure. This issue only deals with the functional test. The JavaScript test has its own issue; see #21 for details.
The cause of the functional test failure is a conflict between output buffering and the Content-Length
header that gets added to every response as of #3295790: Post-response task running (destructable services) are actually blocking; add test coverage and warn for common misconfiguration. The good news is, it's probably only breaking tests, not real sites, since the problem also involves a specific quirk of cURL and how it handles Content-Length
headers. (Real-world browsers probably do not behave this way, although I'm just speculating here.)
A full explanation of the bug may be found in #17.
The proposed resolution is, as yet, uncertain. There are several possible paths forward, but framework manager review is probably needed to decide the right approach.
Remaining tasks
Test coverage is already written, so we just need to decide on the right fix here and implement it.
User interface changes
None.
API changes
TBD, but none expected.
Data model changes
None.
Release notes snippet
TBD