Bug 1952958 - Runtime error loading console in Safari 13
Summary: Runtime error loading console in Safari 13
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.8
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 4.8.0
Assignee: Samuel Padgett
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-23 16:11 UTC by Samuel Padgett
Modified: 2021-07-27 23:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
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
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
different js error and blank page (266.38 KB, image/png)
2021-04-26 01:49 UTC, Yadan Pei
no flags Details
console loaded successfully with safari 13.1.2 (1.53 MB, image/png)
2021-05-07 01:58 UTC, Yadan Pei
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 8761 0 None open Bug 1952958: Gracefully degrade when `Intl.RelativeTimeFormat` unavailable 2021-04-23 16:22:50 UTC
Red Hat Product Errata RHSA-2021:2438 0 None None None 2021-07-27 23:03:47 UTC

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


Note You need to log in before you can comment on or make changes to this bug.