Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object.hasOwn unsupported #4863

Closed
5 tasks
shefalijoshi opened this issue Feb 14, 2022 · 3 comments · Fixed by #4920
Closed
5 tasks

Object.hasOwn unsupported #4863

shefalijoshi opened this issue Feb 14, 2022 · 3 comments · Fixed by #4920

Comments

@shefalijoshi
Copy link
Contributor

shefalijoshi commented Feb 14, 2022

Summary

Using javascript's experimental Object.hasOwn method is causing issues:
Error about Object not having 'hasOwn' property.

Expected vs Current Behavior

Probably use something other than the hasOwn method.

Impact Check List

  • Data loss or misrepresented data?
  • Regression? Did this used to work or has it always been broken?
  • Is there a workaround available?
  • Does this impact a critical component?
  • Is this just a visual bug with no functional impact?

Steps to Reproduce

Environment

  • Open MCT Version:
  • Deployment Type:
  • OS:
  • Browser:

Additional Information

@mariuszr
Copy link
Contributor

mariuszr commented Feb 18, 2022

Hi @shefalijoshi, I have found only one place of the Object.hasOwn() method usage - Telemetry API.js. I assume that the issue refers to the Safari browser that the method is in development and should be supported in a pre-release version.

We can solve it by reimplementing

Object.hasOwn(requestProvider, 'request')

to

Object.prototype.hasOwnProperty.call(requestProvider, 'request')

In this case, I would also recommend adding the following piece of code

typeof requestProvider.request === 'function'

as a && condition to be sure that the request property is also the function - see Telemetry Providers.

@akhenry @jvigliotta @davetsay

@jvigliotta
Copy link
Contributor

Testing

  • confirm you can use the historical request functionality of telemetry api. So just view historical telemetry and confirm no errors in console
  • try multiple browser types

@ozyx
Copy link
Contributor

ozyx commented Jun 9, 2022

Verified -- Testathon 6.9.2022

@unlikelyzero unlikelyzero added this to the Sprint:2.0.7 milestone Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants