microsoft / microsoft/azure-devops-extension-sdk
Custom Forms Control is missing the user descriptor on `SDK.getUser()`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 159
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
In our custom form controls we noticed that the member IUserContext.descriptor is somehow missing from the SDK.getUser() object.
We want to use the descriptor to get membership information from the API of the current user (for a UI-only block).
What we do get is an object similar to this:
{
displayName: "Full Name",
id: "0000000-0000-1000-0000-000000000000",
imageUrl: "https://dev.azure.com/<instance>/_apis/GraphProfile/MemberAvatars/aad.MDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDA=",
name: "Full.Name@domain.tld"
}
As our extension has different contributions, we can see that on others (for example a project/organization settings page contributions) we get the descriptor:
{
descriptor: "aad.MDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDA=",
displayName: "Full Name",
id: "0000000-0000-1000-0000-000000000000",
imageUrl: "https://dev.azure.com/<instance>/_apis/GraphProfile/MemberAvatars/aad.MDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDA=",
name: "Full.Name@domain.tld"
}
However, it seems to be missing on custom form controls...
As this is not documented (the TypeScript type says the field is always there) and I don't see any other good way, I assume this is a Bug. We could:
- parse
imageUrl - compare the data with the full list of users) to get the current user context.
- creating the descriptor ourself from the
id-entry but for some reason the Ids differ (as in the anonymized example above).
We would love to hear a workaround or an alternative approach to solve the problem at hand with the SDK or other REST calls.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with IUserContext in src/SDK.ts and compare the SDK.getUser() result in custom form controls with the result from project or organization settings contributions. Review the linked GraphClient membership methods and reproduce the missing descriptor; done means the descriptor is available for the current user in custom form controls or the supported limitation and workaround are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100