Skip to content

fix: device attributes type #14520

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

Merged
merged 4 commits into from
Aug 21, 2025
Merged

fix: device attributes type #14520

merged 4 commits into from
Aug 21, 2025

Conversation

soberm
Copy link
Contributor

@soberm soberm commented Aug 19, 2025

Description of changes

The runtime structure returned by fetchDevices() contains device attributes as a plain object with keys like device_status, device_name, and last_ip_used, but the TypeScript definition incorrectly defines attributes as AuthUserAttribute<UserAttributeKey> (a single object with attributeKey and value properties). This PR updates the type for device attributes.

Issue #, if available

#14517

Description of how you validated changes

Manually verified that the types are correct.

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@soberm soberm marked this pull request as ready for review August 19, 2025 12:41
@@ -89,11 +88,14 @@ export type AutoSignInEventData =
| {
event: 'autoSignIn';
};

type DeviceAttributeKey = 'device_status' | 'device_name' | 'last_ip_used';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @soberm for looking into this so quickly. It looks like this may not be the full list of predefined attributes (based on the existing type). There also seem to be some custom attributes involved. Could you double check this with the reviewers?

export type UserAttributeKey = AuthStandardAttributeKey | CustomAttribute;

export type AuthStandardAttributeKey =

export type CustomAttribute = string & NonNullable<unknown>;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kturczyski-lz, will double check but the previous type mistakenly used UserAttributes and not DeviceAttributes which are different.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, yeah, sorry, I actually see only those 3 keys in the result. I assumed the old type wasn’t simply ported to the new structure.

@soberm soberm merged commit 4c872d1 into main Aug 21, 2025
36 checks passed
@soberm soberm deleted the fix/device-attributes branch August 21, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants