@@ -108,12 +108,12 @@ export function countUsageForSurvey(score: UsageImpact | number): void {
108108 */
109109export async function promptAfterActionEventually ( score : UsageImpact | number , triggerAction ?: string ) : Promise < void > {
110110 await callWithTelemetryAndErrorHandling ( 'survey.measure-score' , async ( context : IActionContext ) => {
111- context . telemetry . properties . triggerActionScore = score . toString ( ) ;
111+ context . telemetry . measurements . triggerActionScore = typeof score === 'number' ? score : Number ( score ) ;
112112 context . telemetry . properties . triggerAction = triggerAction ;
113113
114114 const globalOptOut = getIsSurveyDisabledGlobally ( ) ;
115- context . telemetry . properties . isSurveyDisabledGlobally = globalOptOut . toString ( ) ;
116- context . telemetry . properties . wasPromptedInSession = surveyState . wasPromptedInSession . toString ( ) ;
115+ context . telemetry . properties . isSurveyDisabledGlobally = globalOptOut ? 'true' : 'false' ;
116+ context . telemetry . properties . wasPromptedInSession = surveyState . wasPromptedInSession ? 'true' : 'false' ;
117117
118118 if ( globalOptOut || surveyState . wasPromptedInSession ) {
119119 return ;
@@ -122,14 +122,14 @@ export async function promptAfterActionEventually(score: UsageImpact | number, t
122122 countUsageForSurvey ( score ) ;
123123
124124 const fullScore = surveyState . usageScore ;
125- context . telemetry . properties . fullScore = fullScore . toString ( ) ;
125+ context . telemetry . measurements . fullScore = fullScore ;
126126
127127 const scoreTargetReached = fullScore >= SurveyConfig . scoring . REQUIRED_SCORE ;
128- context . telemetry . properties . scoreTargetReached = scoreTargetReached . toString ( ) ;
128+ context . telemetry . properties . scoreTargetReached = scoreTargetReached ? 'true' : 'false' ;
129129
130130 if ( scoreTargetReached ) {
131131 const isCandidate = await getIsSurveyCandidate ( ) ;
132- context . telemetry . properties . isCandidate = isCandidate . toString ( ) ;
132+ context . telemetry . properties . isCandidate = isCandidate ? 'true' : 'false' ;
133133 await surveyPromptIfCandidate ( triggerAction ) ;
134134 }
135135 } ) ;
@@ -154,7 +154,7 @@ async function initSurvey(): Promise<void> {
154154 ) : boolean => {
155155 surveyState . isCandidate = isCandidate ;
156156 context . telemetry . properties . reason = reason ;
157- context . telemetry . properties . isCandidate = isCandidate . toString ( ) ;
157+ context . telemetry . properties . isCandidate = isCandidate ? 'true' : 'false' ;
158158
159159 // Add any additional properties
160160 Object . entries ( extraProps ) . forEach ( ( [ key , value ] ) => {
@@ -257,7 +257,7 @@ async function initSurvey(): Promise<void> {
257257 const acceptedForABTest = normalized < SurveyConfig . settings . A_B_TEST_SELECTION ;
258258
259259 return setCandidateStatus ( acceptedForABTest , '07_not_in_ab_test_group' , {
260- acceptedForABTest : acceptedForABTest . toString ( ) ,
260+ acceptedForABTest : acceptedForABTest ? 'true' : 'false' ,
261261 normalizedValue : normalized . toFixed ( 6 ) ,
262262 } ) ;
263263 } catch ( error ) {
@@ -277,7 +277,7 @@ async function surveyPromptIfCandidate(triggerAction?: string): Promise<void> {
277277 }
278278 await callWithTelemetryAndErrorHandling ( 'survey.prompt' , async ( context : IActionContext ) => {
279279 const isCandidate = await getIsSurveyCandidate ( ) ;
280- context . telemetry . properties . isCandidate = isCandidate . toString ( ) ;
280+ context . telemetry . properties . isCandidate = isCandidate ? 'true' : 'false' ;
281281 context . telemetry . properties . triggerAction = triggerAction ;
282282 context . telemetry . properties . userAsked = 'false' ; // this will be set to 'true' later if the user interacts with the prompt
283283 surveyState . wasPromptedInSession = true ; // disarm for the rest of the session
0 commit comments