Skip to content

Conversation

@marcozabel
Copy link

@marcozabel marcozabel commented Nov 18, 2025

This PR

  • This PR integrates the SyncContext from the SyncFlagsResponse into the Evaluation Context using the SyncMetadataHook.

Related Issues

Fixes #1350

@marcozabel marcozabel changed the title feat: Use SyncContext from GrpcFetch instead of Metadata Request feat: Use SyncContext from SyncFlagsResponse instead of Metadata Request Nov 18, 2025
@aepfli
Copy link
Member

aepfli commented Nov 18, 2025

we do have e2e test for testing the sync context with gherkin, you can also enable those, to see if it is running properly :) https://github.com/open-feature/flagd-testbed/blob/1759a9491388e6c9714d5c048916120f77c8d892/gherkin/sync-payload.feature#L4 - those tests should normally work, if you add the missing provider configuration.

@toddbaert
Copy link
Member

You're on the right track, but I think you need to add the transformation function I mentioned here.

@marcozabel marcozabel force-pushed the feat/flagd-use-sync-contex branch from 8888f90 to ed148f2 Compare November 19, 2025 15:54
Signed-off-by: marcozabel <[email protected]>
Signed-off-by: marcozabel <[email protected]>
Signed-off-by: marcozabel <[email protected]>
Signed-off-by: marcozabel <[email protected]>
@marcozabel marcozabel marked this pull request as ready for review November 19, 2025 21:44
@marcozabel marcozabel requested review from a team as code owners November 19, 2025 21:44
@toddbaert toddbaert self-requested a review November 20, 2025 14:17
Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! You only have one small issue, but it's one that will break things so I'm blocking for now: https://github.com/open-feature/js-sdk-contrib/pull/1401/files#r2546237260

@toddbaert
Copy link
Member

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request integrates the SyncContext from the SyncFlagsResponse into the evaluation context, which is a valuable feature. The implementation introduces a new SyncMetadataHook and a contextEnricher configuration option. The overall approach is sound, but I've identified a critical issue with function binding that would lead to runtime errors, a couple of high-severity issues related to type safety and null handling, and a medium-severity suggestion to improve code clarity. Addressing these points will enhance the robustness of this new feature.

@aepfli
Copy link
Member

aepfli commented Nov 21, 2025

we do have an e2e test within the test-bed for this. it seems like the submodule for the testbed in libs/shared/flagd-core is still pointing to an older version which does not contain those tests. can you please update the submodule to at least version https://github.com/open-feature/flagd-testbed/releases/tag/v2.11.0 - where those tests are added to verify this changes are correct. (a newer version would be even better but not needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flagd] use sync_context field instead of GetMetadata

5 participants