LPS-42530 Implement the same fix from BaseUserNOtificationHandler in portal for portal-compat-shared.