You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[REFACTOR] Deprecate sync.GetMetadata and add equivalent field to sync.SyncFlags payload. #1584
Currently, to support static context enrichment via attributes sent from flagd, in-process providers call sync.GetMetadata along with starting the stream. This is not ideal. The stream isn't valid without the metadata response (since it could result in rules not functioning as expected due to missing attributes) and the metadata response is useless without the stream.
We should simply move the metadata into the stream response as an optional property. This should be done in a non-breaking way.
@aepfli You also mentioned something about having another field in the SyncFlags RPC... I think it was to make some of the stream logic more isomorphic between the EventStream (RPC mode) and SyncStream (in-process mode), a type field I think... Can you describe that here? We might want to tackle both at the same time. Also, let's try to imagine how it can be done in a non-breaking way so that old providers are compatible with new implementations and vice-versa.
of course i can elaborate. Currently within the RPC mode we do have the EventStream, which will send on the inital connection a message provider_ready, and for upcoming messages configuration_change. This allows us within the RPC mode to be stateless. As flagd anyways knows when a configuration is established, or when it only informs about updates.
this would allow us to unify the logic, and keep both modes stateless. Currently we need to know, if we have been connected or not as we need to know, if we need to fire a configuration change or provider ready event.
I hope i could shed some light here, and i hope my motivation regarding this unification is clear
of course i can elaborate. Currently within the RPC mode we do have the EventStream, which will send on the inital connection a message provider_ready, and for upcoming messages configuration_change. This allows us within the RPC mode to be stateless. As flagd anyways knows when a configuration is established, or when it only informs about updates.
this would allow us to unify the logic, and keep both modes stateless. Currently we need to know, if we have been connected or not as we need to know, if we need to fire a configuration change or provider ready event.
I hope i could shed some light here, and i hope my motivation regarding this unification is clear
Yep, clear to me. I will add this to the description.
changed the title [-][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field to `sync.SyncFlags` payload.[/-][+][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field, and `type` field to `sync.SyncFlags` payload.[/+]on Mar 7, 2025
changed the title [-][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field, and `type` field to `sync.SyncFlags` payload.[/-][+][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field, and also `type` field, to `sync.SyncFlags` payload.[/+]on Mar 7, 2025
changed the title [-][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field, and also `type` field, to `sync.SyncFlags` payload.[/-][+][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field to `sync.SyncFlags` payload.[/+]on Mar 8, 2025
I was thinking about this. Testing this is currently a little bit hard. Because the information will most likely be sent on both channels, via the dedicated endpoint and via the sync payload, do we have a feature flag (pun intended) to switch between the two of them, e.g., a temporary config flag? This would allow us to test this behaviour with our test harness.
Maybe it is worth adding such a config flag, wdyt?
Activity
toddbaert commentedon Mar 7, 2025
@aepfli You also mentioned something about having another field in the
SyncFlagsRPC... I think it was to make some of the stream logic more isomorphic between theEventStream(RPC mode) andSyncStream(in-process mode), atypefield I think... Can you describe that here? We might want to tackle both at the same time. Also, let's try to imagine how it can be done in a non-breaking way so that old providers are compatible with new implementations and vice-versa.aepfli commentedon Mar 7, 2025
of course i can elaborate. Currently within the RPC mode we do have the EventStream, which will send on the inital connection a message
provider_ready, and for upcoming messagesconfiguration_change. This allows us within the RPC mode to be stateless. As flagd anyways knows when a configuration is established, or when it only informs about updates.see https://buf.build/open-feature/flagd/docs/main:flagd.evaluation.v1#flagd.evaluation.v1.EventStreamResponse
this would allow us to unify the logic, and keep both modes stateless. Currently we need to know, if we have been connected or not as we need to know, if we need to fire a configuration change or provider ready event.
I hope i could shed some light here, and i hope my motivation regarding this unification is clear
toddbaert commentedon Mar 7, 2025
Yep, clear to me. I will add this to the description.I'm actually going to make this a separate issue.
[-][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field to `sync.SyncFlags` payload.[/-][+][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field, and `type` field to `sync.SyncFlags` payload.[/+][-][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field, and `type` field to `sync.SyncFlags` payload.[/-][+][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field, and also `type` field, to `sync.SyncFlags` payload.[/+][-][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field, and also `type` field, to `sync.SyncFlags` payload.[/-][+][REFACTOR] Deprecate `sync.GetMetadata` and add equivalent field to `sync.SyncFlags` payload.[/+]feat: add sync stream type and context (#183)
sync_contextfield instead ofGetMetadatadotnet-sdk-contrib#447sync_contextfield instead ofGetMetadatajs-sdk-contrib#1350sync_contextfield instead ofGetMetadatajava-sdk-contrib#1509sync_contextfield instead ofGetMetadatapython-sdk-contrib#278aepfli commentedon Jul 14, 2025
I was thinking about this. Testing this is currently a little bit hard. Because the information will most likely be sent on both channels, via the dedicated endpoint and via the sync payload, do we have a feature flag (pun intended) to switch between the two of them, e.g., a temporary config flag? This would allow us to test this behaviour with our test harness.
Maybe it is worth adding such a config flag, wdyt?
aepfli commentedon Jul 29, 2025
i think we should also implement this in go-sdk-contrib, or am i missing here something