In the parent task, efforts are being made to reduce reading of $wgUser in favor of accessing the request context.
Until all reads are removed, however, writing to $wgUser is being kept, since any subsequent reads need to know the correct user.
As a temporary measure, I propose that, when setting the context user, the global $wgUser also be set