There is this check in the attach() function
Drupal.behaviors.autologout = {
attach: function (context, settings) {
if (context !== document) {
return;
}
....
Which is attempting to only run the autologout JS behavior once only when the current context is the main DOM "document" / html.
However with big pipe enabled, there can be multiple calls to attach JS behaviors with the document as the context leading to some odd race conditions. (In my case, during the logout process where I see some database locking while 3 different requests try to log out at the exact same time).
To mitigate this, can we use Drupal.once on the html element instead.
Comments
Comment #6
thtas commentedMy network console showing the issue.
Before patch
After patch
Comment #7
thtas commentedComment #9
the_g_bomb commentedThis will need a rebase.
Comment #10
deaom commentedWent and rebased this and when solving conflicts discovered this was already solved. The original MR adds
if (once('autologout-js', 'html', context).length === 0) { return; }but the code already on the 2.x branch solves it likeSo there is no longer a need for this correction as it's already there. I'll leave status as is so maintainer can close it as they wish.
Comment #11
the_g_bomb commentedAs per the previous comment, the other work done has solved this. Please feel free to reopen and update the steps to reproduce if you are still having problems.