Problem
There's 2 features we'd like to support in flagd which we require OFREP enhancements for:
- flagd supports DISABLED flags as seen here, but does this by throwing
FLAG_NOT_FOUND. Instead, we'd like the user experience to resemble a "successful" evaluation, with code default returned and reason=DISABLED.
- flagd will soon support omitting a
defaultVariant, meaning that if targeting does not match, no value is returned; the evaluation would be "successful", code default is returned and reason=DEFAULT.
Neither of these are currently possible in OFREP, because OFREP evaluationSuccess responses require a value and flagd cannot return one here.
Proposed solution(s)
- Make
value in the evaluationSuccess optional, and use a 204 and another 2xx code or similar to indicate that the provider should default gracefully and set the reason appropriately
- Add additional custom errors to specifically indicate this situation (ex:
disabledError and defaultError) which the OFREP provider will catch and use to gracefully default, and set the reason appropriately.
I see either of these as workable, though I have a slight preference for (1).