Bug 1743570 - Always validate schemas in RemoteSettingsExperimentLoader r=emcminn

Differential Revision: https://phabricator.services.mozilla.com/D150692
This commit is contained in:
Barret Rennie 2022-07-12 02:32:43 +00:00
Родитель f922ff35ad
Коммит bfa5aabcfe
1 изменённых файлов: 9 добавлений и 15 удалений

Просмотреть файл

@ -411,22 +411,16 @@ class _RemoteSettingsExperimentLoader {
); );
} }
if (feature.enabled ?? true) { const result = validator.validate(value);
const result = validator.validate(value); if (!result.valid) {
if (!result.valid) { Cu.reportError(
Cu.reportError( `Experiment ${id} branch ${branchIdx} feature ${featureId} does not validate: ${JSON.stringify(
`Experiment ${id} branch ${branchIdx} feature ${featureId} does not validate: ${JSON.stringify( result.errors,
result.errors, undefined,
undefined, 2
2 )}`
)}`
);
return false;
}
} else {
lazy.log.debug(
`Experiment ${id} branch ${branchIdx} feature ${featureId} disabled; skipping validation`
); );
return false;
} }
} }
} }