This MR for #3485655 is based on #3046447 and only exists to be used in projects which want to patch both issues. It should not be merged!