big_pipe JS checkMutation can throw type errors if parentNode is NULL

Created on 29 January 2024, 10 months ago
Updated 20 February 2024, 9 months ago

Problem/Motivation

In πŸ› big_pipe sometimes fails to load blocks Active we added checkMutation(node.parentNode) without checking if node.parentNode wasn't NULL.

It can be NULL in certain circumstances

Steps to reproduce

Unsure, this is only reproducible for me on circle CI (when upgrading from 10.2.0 to 10.2.2) so assume it's something with the page/JS speed during tests.

Full stack trace with aggregation disabled

TypeError: Cannot read properties of null (reading 'nodeType')
    at checkMutation (http://127.0.0.1:8080/core/modules/big_pipe/js/big_pipe.js?v=10.2.2:92:12)
    at checkMutationAndProcess (http://127.0.0.1:8080/core/modules/big_pipe/js/big_pipe.js?v=10.2.2:116:14)
    at NodeList.forEach (<anonymous>)
    at http://127.0.0.1:8080/core/modules/big_pipe/js/big_pipe.js?v=10.2.2:129:18
    at Array.forEach (<anonymous>)
    at MutationObserver.processMutations (http://127.0.0.1:8080/core/modules/big_pipe/js/big_pipe.js?v=10.2.2:128:15)

This is during a PHP JS test (using drupal-test-traits with the selenium2 driver), captured using the js_testing_log_test module.

Proposed resolution

Check node.parentNode

Merge request link

https://git.drupalcode.org/project/drupal/-/merge_requests/6358

Remaining tasks

Figure out how to test if it is testable.

User interface changes

N/a

API changes

N/a

Data model changes

N/a

Release notes snippet

N/a

πŸ› Bug report
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
BigPipeΒ  β†’

Last updated about 19 hours ago

Created by

πŸ‡¦πŸ‡ΊAustralia acbramley

Live updates comments and jobs are added and updated live.
  • 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.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024