Skip to content

Commit

Permalink
fix(connection-form): use a double dash for separating appName identi…
Browse files Browse the repository at this point in the history
…fiers

A single `-` can be hard to separate in cases such a vscode where the defaultAppName is `mongodb-vscode` as well as with UUIDs so we use `--` to make this separation clearer.
  • Loading branch information
gagik committed Mar 7, 2025
1 parent 5bd08a4 commit 39b2b47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('setAppNameParamIfMissing', function () {
connectionString: 'mongodb://atlas/',
})
).to.deep.equal({
connectionString: 'mongodb://atlas/?appName=defaultAppName-789-123',
connectionString: 'mongodb://atlas/?appName=defaultAppName--789--123',
});
});
});
4 changes: 2 additions & 2 deletions packages/connection-form/src/utils/set-app-name-if-missing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export function setAppNameParamIfMissing({
if (!searchParams.has('appName') && defaultAppName !== undefined) {
const appName = isAtlas
? `${defaultAppName}${
telemetryAnonymousId ? `-${telemetryAnonymousId}` : ''
}-${connectionId}`
telemetryAnonymousId ? `--${telemetryAnonymousId}` : ''
}--${connectionId}`
: defaultAppName;

searchParams.set('appName', appName);
Expand Down

0 comments on commit 39b2b47

Please sign in to comment.