-
Notifications
You must be signed in to change notification settings - Fork 29
chore: switch to @mongodb-js/device-id
#196
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
Conversation
This package is meant to minimize code replication and to make sure the approach we're taking with hashing is consistent.
@@ -1,5 +1,5 @@ | |||
/** @type {import('ts-jest').JestConfigWithTsJest} **/ | |||
export default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into jestjs/jest#15312, possibly because of a TypeScript update, so just going to keep it as a .cjs
file for the time being
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
this.deviceIdPromise = getDeviceId({ | ||
getMachineId: () => this.getRawMachineId(), | ||
onError: (reason, error) => { | ||
switch (reason) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honestly seeing this used like this does make me think we should instead throw typed error objects and check instanceof
as reason feels a bit redundant but this is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was debating between the two for a while - ended up going with a reason
because that was more explicit about the possible values as opposed to Error
inheritors, where you'd need to figure out what the options are.
This package is meant to minimize code replication and to make sure the approach we're taking with hashing is consistent and timeouts are automatically handled.
See mongodb-js/devtools-shared#532