flipt icon indicating copy to clipboard operation
flipt copied to clipboard

[FEATURE]: Event trigger when flag changes state

Open ericvdberge opened this issue 1 year ago • 6 comments

Problem

Hello Flipt team,

I started using the flipt docker container together with the C# GRPC SDK. I have a database and a redis cache configured in my C# API and added some feature flags. After testing some usecases, I missed a feature that I would like to request.

Use-case: I had a simple feature switch that switches between fetching 10 or 5 items at a time depending on the feature switch. I have redis configured for that route. The problem is that the feature switch does nothing because the cache takes over.

Ideal Solution

It would be nice to be able to listen for an event when a flag state is changed. This could not only be nice to invalidate cache, but also do something with e-mailing, logging insights before and after switching flag state, etc.

Search

  • [X] I searched for other open and closed issues before opening this

Additional Context

No response

ericvdberge avatar Nov 02 '23 08:11 ericvdberge

Morning @ericvdberge ! Great suggestion. Pushing state to clients is something we’ve talked about before. Can definitely see the value there.

Just to clarify in your example. When you say you use Redis, you are referring to in your own application? As opposed to using Redis as a cache backend for Flipt? Or am I mistaken?

GeorgeMac avatar Nov 02 '23 09:11 GeorgeMac

hi @GeorgeMac, Yes indeed. Redis is within my own application and not within Flipt.

ericvdberge avatar Nov 02 '23 09:11 ericvdberge

@ericvdberge sorry for the long delay in response time. Until we have a better solution, I was wondering if you would be able to leverage our webhook functionality for invalidating cached flags in your application: https://www.flipt.io/docs/configuration/auditing/webhooks

markphelps avatar Dec 11 '23 23:12 markphelps

also would be cool to have it exposed as open feature provider_configuration_changed event https://openfeature.dev/docs/reference/concepts/events/#provider_configuration_changed if possible

SuddenGunter avatar Jul 02 '24 18:07 SuddenGunter

@SuddenGunter we could likely do this more easily with our client side sdks especially once we implement https://github.com/flipt-io/flipt-client-sdks/issues/294

would that work ?

markphelps avatar Jul 04 '24 01:07 markphelps