File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import * as cp from 'child_process';
7
7
import * as fs from 'fs' ;
8
8
import * as path from 'path' ;
9
9
import * as util from 'util' ;
10
+ import { URL } from 'url' ;
10
11
import { getStateConfig } from '../goSurvey' ;
11
12
import { getBinPath } from '../util' ;
12
13
import { updateGlobalState } from '../stateUtils' ;
@@ -100,6 +101,13 @@ export async function getLatestDeveloperSurvey(now: Date): Promise<DeveloperSurv
100
101
lastDateUpdated : now
101
102
} ;
102
103
104
+ // The survey URL stored in config.json is the raw survey URL. We add the
105
+ // s=v (for vscode) query parameter to identify the source of the survey
106
+ // respondent.
107
+ const url = new URL ( config . URL ) ;
108
+ url . searchParams . append ( 's' , 'v' ) ;
109
+ config . URL = url . toString ( ) ;
110
+
103
111
updateGlobalState ( DEVELOPER_SURVEY_CONFIG_STATE_KEY , JSON . stringify ( newState ) ) ;
104
112
105
113
outputChannel . info ( `Using fetched Go developer survey: ${ newState . version } ` ) ;
Original file line number Diff line number Diff line change @@ -112,13 +112,13 @@ suite('developer survey tests', () => {
112
112
const oldConfig : config . DeveloperSurveyConfig = {
113
113
StartDate : new Date ( '2025-07-01T00:00:00Z' ) ,
114
114
EndDate : new Date ( '2025-08-01T00:00:00Z' ) ,
115
- URL : 'https://google.com/survey/old'
115
+ URL : 'https://google.com/survey/old?s=v '
116
116
} ;
117
117
118
118
const newConfig = {
119
119
StartDate : new Date ( '2025-09-01T00:00:00Z' ) ,
120
120
EndDate : new Date ( '2025-10-01T00:00:00Z' ) ,
121
- URL : 'https://google.com/survey/new'
121
+ URL : 'https://google.com/survey/new?s=v '
122
122
} ;
123
123
124
124
// old state, now, module survey config => return survey config
You can’t perform that action at this time.
0 commit comments