{"record":{"id":"a5b9a939ae3818b8","repo":"flippercloud/flipper","slug":"gate-is-not-supported-by-this-adapter-yet-a5b9a9","errorCode":null,"errorMessage":"#{gate} is not supported by this adapter yet","messagePattern":"#(.+?) is not supported by this adapter yet","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/flipper/adapters/pstore.rb","lineNumber":90,"sourceCode":"          read_many_features(features)\n        end\n      end\n\n      # Public\n      def enable(feature, gate, thing)\n        @store.transaction do\n          case gate.data_type\n          when :boolean\n            clear_gates(feature)\n            write key(feature, gate), thing.value.to_s\n          when :integer\n            write key(feature, gate), thing.value.to_s\n          when :set\n            set_add key(feature, gate), thing.value.to_s\n          when :json\n            write key(feature, gate), Typecast.to_json(thing.value)\n          else\n            raise \"#{gate} is not supported by this adapter yet\"\n          end\n        end\n\n        true\n      end\n\n      # Public\n      def disable(feature, gate, thing)\n        case gate.data_type\n        when :boolean\n          clear(feature)\n        when :integer\n          @store.transaction do\n            write key(feature, gate), thing.value.to_s\n          end\n        when :set\n          @store.transaction do\n            set_delete key(feature, gate), thing.value.to_s","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/flippercloud/flipper/blob/1f86de3ec91521585b156445e156642938b19cb0/lib/flipper/adapters/pstore.rb#L72-L108","documentation":"The PStore adapter (shipped inside the flipper gem) persists gate values under 'feature_key/gate_key' paths and picks the storage operation from Gate#data_type inside a transaction: :boolean clears all gates then writes, :integer writes, :set appends a member, :json writes via Typecast.to_json; the else branch raises (lib/flipper/adapters/pstore.rb:77-92). All built-in gates map to those four types and Feature#gates is a fixed set (lib/flipper/feature.rb:412-420), so this raise comes from a gate the adapter was never taught — a custom Gate subclass or a spec double — or a flipper release old enough to predate the :json branch receiving expression writes.","triggerScenarios":"feature.enable(...) (or enable_actor/enable_percentage_of_*) where gate_for(thing) matches a custom gate or test double whose data_type is not :boolean/:integer/:set/:json — for example a gate ported from a patched flipper fork that added a data type such as :float.","commonSituations":"Building custom targeting gates against the pstore adapter; a monorepo where one app runs a patched flipper with extra data types while another writes via stock pstore; RSpec gate doubles that omit data_type.","solutions":["List the gate types to find the offender: feature.gates.map { |g| [g.key, g.data_type] } — anything outside %i[boolean integer set json] is the problem.","Re-map the custom gate's data_type to :json (values serialize with Flipper::Typecast.to_json and read back with from_json) or another supported type.","Fix spec doubles to return a real built-in gate or a supported data_type symbol.","If the running flipper predates :json support (pre-expression releases), upgrade the flipper gem — current releases handle :json in PStore#enable."],"exampleFix":"# before: custom gate with an unknown data type\nclass Gates::Bucket < Flipper::Gate\n  def data_type = :float # PStore#enable raises '... is not supported by this adapter yet'\nend\n\n# after: reuse the json data type\nclass Gates::Bucket < Flipper::Gate\n  def data_type = :json # stored via Typecast.to_json, read via Typecast.from_json\nend","handlingStrategy":"validation","validationCode":"SUPPORTED = %i[boolean integer set json].freeze\n\ndef gates_persistable?(feature)\n  feature.gates.all? { |g| SUPPORTED.include?(g.data_type) }\nend\n\nraise ArgumentError, 'unsupported gate in feature set' unless gates_persistable?(feature)","typeGuard":"def supported_data_type?(gate)\n  %i[boolean integer set json].include?(gate.data_type)\nend","tryCatchPattern":"begin\n  feature.enable(thing)\nrescue RuntimeError => e\n  raise unless e.message.include?('is not supported by this adapter yet')\n  warn \"flipper/pstore: gate #{feature.key} rejected: #{e.message}\"\nend","preventionTips":["Map custom gate values onto :json (Typecast.to_json/from_json) instead of new data types.","Check gate.data_type via Gate#inspect when adding gates to confirm it reports a supported symbol.","Avoid spec doubles for gates; use the real Flipper::Gates classes.","Upgrade flipper as a whole so the pstore adapter and gate set always match."],"tags":["ruby","flipper","adapter","pstore","gates","data-type","custom-gate"],"backgroundTag":"unsupported-adapter-data-type","analyzedSha":"1f86de3ec91521585b156445e156642938b19cb0","analyzedAt":"2026-08-23T04:36:09.896Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}