Skip to content

chore: switch to @mongodb-js/device-id #2446

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 11 commits into from
Jun 2, 2025
Merged

Conversation

gagik
Copy link
Contributor

@gagik gagik commented May 5, 2025

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

@gagik gagik added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label May 5, 2025
public setupTelemetryPromise: Promise<void> = Promise.resolve();

// eslint-disable-next-line @typescript-eslint/no-empty-function
private resolveDeviceId: (value: string) => void = () => {};
private readonly telemetrySetup: AbortController = new AbortController();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not a huge fan of this name, maybe deviceIdResolution though I was thinking this would be shared by the entire setup.
I could also call it abortController but seems like a implementation detail.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I do think it's odd to refer to an abort mechanism as ...Setup 🙂 No strong feelings here but maybe just telemetrySetupAbort?

@gagik gagik requested a review from nirinchev June 2, 2025 09:06
@gagik gagik force-pushed the gagik/use-shared-device-id branch from 003520f to 7850337 Compare June 2, 2025 09:37
}),
]);
// eslint-disable-next-line @typescript-eslint/no-var-requires
const getMachineId = require('native-machine-id').getMachineId;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This was previously in a try/catch (to avoid crashing mongosh in situations in which we cannot load this), should it continue to be?

@gagik gagik force-pushed the gagik/use-shared-device-id branch from aea1f71 to cf2e0ef Compare June 2, 2025 11:39
@gagik gagik force-pushed the gagik/use-shared-device-id branch from cf2e0ef to 377de04 Compare June 2, 2025 12:00
@gagik gagik merged commit 642243f into main Jun 2, 2025
60 of 61 checks passed
@gagik gagik deleted the gagik/use-shared-device-id branch June 2, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants