From bfa5aabcfe133c76e3005e305b106c5c092d07dd Mon Sep 17 00:00:00 2001 From: Barret Rennie Date: Tue, 12 Jul 2022 02:32:43 +0000 Subject: [PATCH] Bug 1743570 - Always validate schemas in RemoteSettingsExperimentLoader r=emcminn Differential Revision: https://phabricator.services.mozilla.com/D150692 --- .../lib/RemoteSettingsExperimentLoader.jsm | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/toolkit/components/nimbus/lib/RemoteSettingsExperimentLoader.jsm b/toolkit/components/nimbus/lib/RemoteSettingsExperimentLoader.jsm index 4efb6027ab31..7c96e02f8431 100644 --- a/toolkit/components/nimbus/lib/RemoteSettingsExperimentLoader.jsm +++ b/toolkit/components/nimbus/lib/RemoteSettingsExperimentLoader.jsm @@ -411,22 +411,16 @@ class _RemoteSettingsExperimentLoader { ); } - if (feature.enabled ?? true) { - const result = validator.validate(value); - if (!result.valid) { - Cu.reportError( - `Experiment ${id} branch ${branchIdx} feature ${featureId} does not validate: ${JSON.stringify( - result.errors, - undefined, - 2 - )}` - ); - return false; - } - } else { - lazy.log.debug( - `Experiment ${id} branch ${branchIdx} feature ${featureId} disabled; skipping validation` + const result = validator.validate(value); + if (!result.valid) { + Cu.reportError( + `Experiment ${id} branch ${branchIdx} feature ${featureId} does not validate: ${JSON.stringify( + result.errors, + undefined, + 2 + )}` ); + return false; } } }