Almost all users seem to fall under control group with current experimental setup.
[
{
"name": "AlwaysDisplayTestExplorer - experiment",
"salt": "AlwaysDisplayTestExplorer",
"min": 80,
"max": 100
},
{
"name": "AlwaysDisplayTestExplorer - control",
"salt": "AlwaysDisplayTestExplorer",
"min": 0,
"max": 20
}
]
Logic for checking if you are in an experiment: In Experiment(foo) =HASH>=min and < max.
Probable Bug : We expect to get HASH from CryptoUtils, which apparently is always returning 0 as hash value, so users always fall under AlwaysDisplayTestExplorer - control group.
export class CryptoUtils implements ICryptoUtils {
public createHash<E extends keyof IHashFormat>(data: string, encoding: HexBase64Latin1Encoding, hashFormat: E): IHashFormat[E] {
const hash = createHash('sha512').update(data).digest(encoding);
return hashFormat === 'number' ? parseInt(hash, undefined) : hash as any;
}
}
In the code, parseInt is being used incorrectly. Pass a second parameter, 16 to it instead of passing undefined, so it correctly parses hex encoded string to int.
Almost all users seem to fall under control group with current experimental setup.
[ { "name": "AlwaysDisplayTestExplorer - experiment", "salt": "AlwaysDisplayTestExplorer", "min": 80, "max": 100 }, { "name": "AlwaysDisplayTestExplorer - control", "salt": "AlwaysDisplayTestExplorer", "min": 0, "max": 20 } ]Logic for checking if you are in an experiment: In Experiment(foo) =
HASH>=min and < max.Probable Bug : We expect to get
HASHfromCryptoUtils, which apparently is always returning0as hash value, so users always fall underAlwaysDisplayTestExplorer - controlgroup.In the code,
parseIntis being used incorrectly. Pass a second parameter,16to it instead of passingundefined, so it correctly parseshexencoded string to int.