Leaderboard Cohorts use Stats search criteria for evaluating Stats-based eligibility rules. The validation has an incorrect list of relation names. Notably it specifies "le" instead of "lte" and it fails validation if you put in the correct one ("lte"). The list of correct relation short names is: "eq", "neq", "lt", "lte", "gt", "gte", "in", "nin". There are also long names for many of these.
Since it is impossible to publish content when the validation is failing, the validation for these Stats relations needs to either be more permissive or needs to be correct about the values it allows.
Reproducing the Behavior
Steps to Reproduce
Open Content Manager in a Unity project with Beamable.
Create a new piece of leaderboards content.
Enable Cohorts and add a cohort.
Give the cohort a name and add a stat rule
Try to specify "lte" or "lessthanequal" as the relation.
Expected behavior
Content Manager accepts "lte" or "lessthanequal" and allows publishing content.
Actual behavior
Content Manager fails to validate the stat rule and states an incorrect list of allowed relations.
Screenshots
Metadata
SDK version: Beamable SDK 1.19.22 or lower
Engine version: any
Operating System: any
Additional context
The set of allowed relations is defined by Scala code in the ObjectStatsRepository.search method:
case "equal" | "eq" => "$eq"
case "notequal" | "neq" => "$ne"
case "lessthan" | "lt" => "$lt"
case "lessthanequal" | "lte" => "$lte"
case "greaterthan" | "gt" => "$gt"
case "greaterthanequal" | "gte" => "$gte"
case "in" => "$in"
case "notin" | "nin" => "$nin"
Describe the Bug
Leaderboard Cohorts use Stats search criteria for evaluating Stats-based eligibility rules. The validation has an incorrect list of relation names. Notably it specifies "le" instead of "lte" and it fails validation if you put in the correct one ("lte"). The list of correct relation short names is: "eq", "neq", "lt", "lte", "gt", "gte", "in", "nin". There are also long names for many of these.
Since it is impossible to publish content when the validation is failing, the validation for these Stats relations needs to either be more permissive or needs to be correct about the values it allows.
Reproducing the Behavior
Steps to Reproduce
leaderboards
content.Expected behavior
Actual behavior
Screenshots
Metadata
Additional context
The set of allowed relations is defined by Scala code in the ObjectStatsRepository.search method: