Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/cli-repl/src/cli-repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ class CliRepl {
async setConfig<K extends keyof UserConfig>(key: K, value: UserConfig[K]): Promise<void> {
this.config[key] = value;
if (key === 'enableTelemetry') {
this.config.disableGreetingMessage = true;
this.bus.emit('mongosh:update-user', this.config.userId, this.config.enableTelemetry);
}
try {
Expand Down
1 change: 1 addition & 0 deletions packages/cli-repl/src/mongosh-repl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ describe('MongoshNodeRepl', () => {
expect(output).to.match(/Using MongoDB:\s+4.4.1/);
expect(output).to.match(/Using Mongosh Beta:/);
expect(output).to.match(/You can opt-out by running the .*disableTelemetry\(\).* command/);
expect(config.disableGreetingMessage).to.equal(true);
});

it('evaluates javascript', async() => {
Expand Down
1 change: 1 addition & 0 deletions packages/cli-repl/src/mongosh-repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ class MongoshNodeRepl implements EvaluationListener {
text += `${MONGOSH_WIKI}\n`;
if (!await this.configProvider.getConfig('disableGreetingMessage')) {
text += `${TELEMETRY_GREETING_MESSAGE}\n`;
await this.configProvider.setConfig('disableGreetingMessage', true);
}
this.output.write(text);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-repl/test/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ describe('e2e', function() {
const config = await readConfig();
expect(config.userId).to.match(/^[a-f0-9]{24}$/);
expect(config.enableTelemetry).to.be.true;
expect(config.disableGreetingMessage).to.be.false;
expect(config.disableGreetingMessage).to.be.true;
});

it('persists between sessions', async() => {
Expand Down