Matomo Endless Loop after user has revoked consent

I am getting an endless loop, after a user that has revoked his consent and tries to renew the consent.

This error can be spotted when looking at the ‘setConsentCookie’ method in the piwik.js (

In this method a for loop exists that iterates over the content of ‘consentRequestsQueue’.
However inside the loop the ‘sendRequest’ might be called which leads to this line ( where the request is pushed into the queue when the user has not given consent.

This grows the queue infinitely and the for loop never terminates causing the browser to hang.