Bug 1952958

Summary: Runtime error loading console in Safari 13
Product: OpenShift Container Platform Reporter: Samuel Padgett <spadgett>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.8CC: aos-bugs, jokerman, yapei
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Version: 4.8.0-0.nightly-2021-04-23-034722 Cluster ID: c167e14b-30b1-42c3-9031-6847d533e10a Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:87.0) Gecko/20100101 Firefox/87.0
Last Closed: 2021-07-27 23:03:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
different js error and blank page
none
console loaded successfully with safari 13.1.2 none

Description Samuel Padgett 2021-04-23 16:11:50 UTC
Running console in an old version of Safari results in the error:

```
TypeError: undefined is not a constructor (evaluating 'new Intl.RelativeTimeFormat(getLocale() || undefined)')
```

We're using `Intl.RelativeTimeFormat`, which is only available in Safari 14 and newer. See 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat#browser_compatibility

We should fall back to showing the full date in cases where the browser API is not available.

This is only an issue in OpenShift 4.8 and not a bug present in any shipped OpenShift version. This was introduced in https://github.com/openshift/console/pull/8490. The backport PR https://github.com/openshift/console/pull/8734 does not remove moment.js, so it doesn't use the problematic API.

Comment 1 Samuel Padgett 2021-04-23 16:18:03 UTC
Note to QE: Bug 1952635 prevents console from showing content in Safari as well. Even with this bug fix, you will not be able to use console in Safari until the other bug is fixed. You can verify that the runtime error has been addressed by inspecting the JavaScript console or checking that at least the masthead renders.

Comment 3 Yadan Pei 2021-04-26 01:49:00 UTC
Due to bug 1952635 console is only showing main header which is expected now(without fix)

However I still see a total blank page returned and a different JS error on 12.0.2, see screenshot

Assigning back for confirmation, this is checked against 4.8.0-0.nightly-2021-04-25-183122


# oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.8.0-0.nightly-2021-04-25-183122   True        False         96m     Cluster version is 4.8.0-0.nightly-2021-04-25-183122
# oc get pods -n openshift-console
NAME                        READY   STATUS    RESTARTS   AGE
console-5cc6576f6-fgrxw     1/1     Running   0          90m
console-5cc6576f6-j4fbc     1/1     Running   0          92m
downloads-8dcc96bf7-6k7nn   1/1     Running   0          92m
downloads-8dcc96bf7-jcgls   1/1     Running   0          86m
# oc get pod console-5cc6576f6-fgrxw -o yaml -n openshift-console| grep image
    console.openshift.io/image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:8f415605b8327d010c52df944132256f474c4531ab3f250740e97c661f383729

# oc image info quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:8f415605b8327d010c52df944132256f474c4531ab3f250740e97c661f383729 | grep commit
             io.openshift.build.commit.id=9e594aeaba09a23b72079f4071e3e43d8040b3fd
             io.openshift.build.commit.url=https://github.com/openshift/console/commit/9e594aeaba09a23b72079f4071e3e43d8040b3fd
[root@preserved-qe-ui-rhel-1 console]# git log 9e594aeaba09a23b72079f4071e3e43d8040b3fd | grep '#8761'
    Merge pull request #8761 from spadgett/detect-relative-time-formatter

Comment 4 Yadan Pei 2021-04-26 01:49:55 UTC
Created attachment 1775382 [details]
different js error and blank page

Comment 5 Samuel Padgett 2021-04-26 15:30:18 UTC
`Promise.allSettled` seemed to have been added for dynamic plugin loading.

❯ rg -F 'allSettled'
frontend/packages/console-dynamic-plugin-sdk/src/api/useResolvedExtensions.ts
50:    // The promise returned by Promise.allSettled() never rejects; no need for catch-or-return.
52:    Promise.allSettled(

frontend/packages/console-dynamic-plugin-sdk/src/utils/promise.ts
2: * Unwrap the result of `Promise.allSettled` call as `[fulfilledValues, rejectedReasons]` tuple.

It looks like Safari 13 or newer is available for all supported versions of macOS. You have to go back to Sierra (5 versions ago) to require Safari 12. Given this, I think it's fair to ask users to upgrade Safari to a supported version. Moving back on ON_QA.

https://en.wikipedia.org/wiki/Safari_version_history#Safari_12

Comment 6 Yadan Pei 2021-04-29 02:39:32 UTC
Hi Sam,

I got these js error and blank page using Safari 12(as screenshot shows), am I using the wrong version to verify the bug?

Comment 7 Samuel Padgett 2021-04-29 15:47:37 UTC
Hi, Yadan. Please use Safari 13 to verify.

* Safari 14 is the latest and fully supported.
* Safari 13 is no longer supported by Apple and is best effort support for OpenShift. The bug fix addresses the runtime error for Safari 13 only.
* Safari 12 is quite old and no longer supported by Apple. You'd have to be running macOS Sierra to not be able to upgrade to at least Safari 13. High Sierra, Mojave, Catalina, and Big Sur have all been released since macOS Sierra, so it's an old macOS version and no longer supported.

Comment 8 Yadan Pei 2021-05-07 01:55:58 UTC
Visit OCP console with Safari 13.1.2, now console is loaded successfully, see screenshot

Verified on 4.8.0-0.nightly-2021-05-06-162549 and Safari 13.1.2

Comment 9 Yadan Pei 2021-05-07 01:58:12 UTC
Created attachment 1780548 [details]
console loaded successfully with safari 13.1.2

Comment 13 errata-xmlrpc 2021-07-27 23:03:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438