Features behind flags that default to "on" cannot be disabled

Summary

Features behind feature flags that default to "on" cannot be disabled.

Steps to reproduce

  1. Choose a feature flag that defaults to "on", like productivity_analytics or productivity_analytics_scatterplot_enabled.
  2. Attempt to disable the feature with Feature.disable.
  3. See that the feature is still enabled.

Note: This happens whether you have previously run Feature.enable or not.

What is the current bug behavior?

The feature still appears after you call Feature.disable.

What is the expected correct behavior?

The feature disappears after you call Feature.disable

Relevant logs and/or screenshots

The Flipper gem is not compatible with feature flags that default to "on". At least with its ActiveRecord adapter, calling disable destroys the database record. When there is no record, the default applies. And for these features the default is "on". For Flipper to be compatible with feature flags that default to "on", it would need to modify the database record with a value of "false" instead of destroying it.

If you manually update the feature_gates record with a value of "false" (instead of calling Feature.disable) then the feature is hidden as desired.

Possible fixes

  • Eliminate feature flags that default to "on" (easier)
  • Revert feature flags that default to "on", to default to "off" (easier)
  • Customize the Flipper gem, or our usage of it (harder)
Edited Oct 22, 2019 by Dan Jensen
Assignee Loading
Time tracking Loading