Because we see currently that this sometimes gets ...
# ask-questions
m
Because we see currently that this sometimes gets updated through streaming and sometimes it doesn't get updated, yet changes to rules are immediately updated always, so I'm wondering if streaming the status of not-enabled features is undefined / unsupported.
s
Not sure if I understand exactly what's happening. The SDK connection is set on a per-environment basis, so you'd have a different client key for prod vs staging. For non-enabled features, they wouldn't be included in the payload at all.
m
Yeah, let me simplify the question, apologies. My question boils down to: • I have an environment, say production • I have a feature foo, that is not enabled for that environment (the toggle button under: Enabled Environments) • The feature foo has the Default Value set to TRUE • I enable / toggle on the feature foo for the environment production Should the application now stream / receive an event that the feature flag foo isEnabled? Or should a feature be enabled for an environment, and are only the rule-based / default value streamed to the application?
s
Yes, if a feature is toggled off, then on, that change should be streamed with SSE.
However, if the value is changed, that won't be streamed because features that aren't toggled on at all aren't included in the features payload.
m
Alright, so it should also be streamed if you toggle it on for that environment (and it wasn't toggled on before) or does it only work if it's on-off-on and off-on won't work because it was never in the original payload?
s
The payload has this shape when toggled on:
Copy code
features: {
  feature-name: {}
but that key
feature-name
will be totally absent when toggled off at the top level. Note this is only applying to that top level toggle (kill switch), not the flag's value. Toggled on/off will be streamed. Does that answer the question?