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

Deprecated property of Web API (nagivator.oscpu and nagivator.platform) used in Azure SDK / Azure Identity #24758

Closed
4 tasks
metzenseifner opened this issue Feb 7, 2023 · 4 comments
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@metzenseifner
Copy link

  • Package Name:

Azure SDK Core

in particular, https://www.npmjs.com/package/@azure/identity

  • Package Version:

Latest commit e4838de

https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/src/util/userAgentPlatform.browser.ts#L23-L26

  • Operating system:

  • typescript

    • version: any
  • Is the bug related to documentation in

Describe the bug
The mdn Web API declares globalThis.navigator.oscpu and globalThis.navigator.platform to be deprecated. These should be removed from the SDK.

To Reproduce
N/A

Expected behavior
Azure SDK does not use deprecated features.

Screenshots
N/A

Additional context
It has caused incompatibilities with our Deno-based JS Runtime. Therefore, a hack had to be introduced that manually sets the globalThis.navigator.platform. This should not be necessary.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 7, 2023
@xirzec
Copy link
Member

xirzec commented Feb 7, 2023

Looks like navigator.userAgent and this experimental API might be viable alternatives: https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData

Certainly we should be doing better feature detection than today either way.

@xirzec xirzec added Client This issue points to a problem in the data-plane of the library. Azure.Core labels Feb 7, 2023
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 7, 2023
@mpodwysocki
Copy link
Member

@metzenseifner why is the browser file being used versus the node interop for Deno?

mpodwysocki added a commit that referenced this issue Feb 9, 2023
### Packages impacted by this PR

- [@azure/core-rest-pipeline]

### Issues associated with this PR

#24758

### Describe the problem that is addressed by this PR

Relies on the deprecated `oscpu`. This uses the non-standard
`globalThis.navigator.userAgentData.platform` and falls back to the
deprecated `globalThis.navigator.platform`.

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?

We could have removed the OS checks overall, but we can get better
telemetry to keep the OS detection.

### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
@mpodwysocki
Copy link
Member

Fixed as per #24809

@metzenseifner
Copy link
Author

@mpodwysocki

In response to

why is the browser file being used versus the node interop for Deno?

I am sorry that I do not know the answer to this question. However, maybe the answer is irrelevant, being as this problem has been fixed.

@github-actions github-actions bot locked and limited conversation to collaborators May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants