Skip to content
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

Pipe language edit counts into CES survey #124006

Merged
merged 1 commit into from May 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/vs/workbench/contrib/surveys/browser/ces.contribution.ts
Expand Up @@ -22,7 +22,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import { Event } from 'vs/base/common/event';

const WAIT_TIME_TO_SHOW_SURVEY = 1000 * 60 * 60; // 1 hour
const MIN_WAIT_TIME_TO_SHOW_SURVEY = 1000 * 60 * 5; // 5 minutes
const MIN_WAIT_TIME_TO_SHOW_SURVEY = 1000 * 60 * 2; // 2 minutes
const MAX_INSTALL_AGE = 1000 * 60 * 60 * 24; // 24 hours
const REMIND_LATER_DELAY = 1000 * 60 * 60 * 4; // 4 hours
const SKIP_SURVEY_KEY = 'ces/skipSurvey';
Expand Down Expand Up @@ -78,7 +78,18 @@ class CESContribution extends Disposable implements IWorkbenchContribution {
run: () => {
sendTelemetry('accept');
this.telemetryService.getTelemetryInfo().then(info => {
this.openerService.open(URI.parse(`${this.productService.cesSurveyUrl}?o=${encodeURIComponent(platform)}&v=${encodeURIComponent(this.productService.version)}&m=${encodeURIComponent(info.machineId)}`));
let surveyUrl = `${this.productService.cesSurveyUrl}?o=${encodeURIComponent(platform)}&v=${encodeURIComponent(this.productService.version)}&m=${encodeURIComponent(info.machineId)}`;

const usedParams = this.productService.surveys
?.filter(surveyData => surveyData.surveyId && surveyData.languageId)
// Counts provided by contrib/surveys/browser/languageSurveys
.filter(surveyData => this.storageService.getNumber(`${surveyData.surveyId}.editedCount`, StorageScope.GLOBAL, 0) > 0)
.map(surveyData => `${encodeURIComponent(surveyData.languageId)}Lang=1`)
.join('&');
if (usedParams) {
surveyUrl += `&${usedParams}`;
}
this.openerService.open(URI.parse(surveyUrl));
this.skipSurvey();
});
}
Expand Down