explain()
explain() is synchronous and local, like flag(). It does not record exposure.
Fields
| Field | Meaning |
|---|---|
value | What flag() returns (without a fallback). |
reason | One of the reasons below. |
ruleId | The rule that decided, for rule_match, rollout_match and rollout_miss. |
bucket | This identity’s bucket, 0…9999, for rollout_match and rollout_miss. |
revision | The snapshot revision the decision used. |
source | "none", "cache" or "remote". |
context | The runtime context the rules were matched against, or null before the local read finished. |
audiences | The audiences the decision could reference, from the same snapshot. |
Reasons
Evaluation runs in this order and stops at the first answer:
| Reason | When |
|---|---|
flag_missing | The snapshot has no such flag, or the client has not finished its local read (context is null). Value false. |
disabled | The flag is disabled. Value false, whatever the rules say. |
rule_match | The first rule whose conditions all match has no percentage (or 100%). Value is the rule’s value. |
rollout_match | That rule has a percentage and this identity’s bucket is below it. Value is the rule’s value. |
rollout_miss | That rule has a percentage and the bucket is not below it. Value is the flag’s default. |
default | No rule matched. Value is the flag’s default. |
A rollout miss does not fall through to the next rule: “you are not in the 25%” is an answer, not an absence of one.