Skip to content

Conversation

Zaimwa9
Copy link
Contributor

@Zaimwa9 Zaimwa9 commented Aug 1, 2025

This PR

This PR aims to upgrade the flagsmith provider in order to be compatible with latest versions of the flagsmith sdk (from 4.x.x to 9.x.x).

Main breaking change from those versions was the introduction of evaluationContext in the FS sdk and the use of flagsmithClient.setContext to properly identify users and assign traits (also stores the environment ApiKey).

export interface EvaluationContext {
    environment?: null | EnvironmentEvaluationContext;
    identity?:    null | {
        identifier?: null | string;
        traits?:     { [key: string]: null | TraitEvaluationContext };
    };
}

This was not compatible with the flagsmith-client-provider which was switching identity using the deprecated this.identity

Related Issues

#1351 solved a similar bug. It feels cleaner to bump the version - which does include the fix. I can include the Readme updates and close the previous one?

Notes

Follow-up Tasks

Following-up on the discussion here
Refactoring in a more abstract way should come in a different scope 👍

How to test

  1. Clone repo
cd libs/providers/flagsmith-client/
npm i
npm link
  1. Clone flagsmith open feature example here
npm i
npm link @openfeature/flagsmith-client-provider
  1. Play around :)

BEGIN_COMMIT_OVERRIDE
feat(flagsmith): upgrade-provider-to-latest-flagsmith-client-version

Release-As: 0.2.0
END_COMMIT_OVERRIDE

@Zaimwa9 Zaimwa9 requested review from a team as code owners August 1, 2025 13:03
@Zaimwa9 Zaimwa9 force-pushed the chore/feature-provider-flagsmith-sdk-upgrade branch 2 times, most recently from 7e8375f to 95c5af3 Compare August 1, 2025 13:06
@github-actions github-actions bot requested a review from thomaspoignant August 1, 2025 13:06
renovate bot and others added 6 commits August 12, 2025 10:39
… v2.10.2 (open-feature#1355)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: wadii <[email protected]>
…ature#1359)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: wadii <[email protected]>
Signed-off-by: wadii <[email protected]>
@Zaimwa9 Zaimwa9 force-pushed the chore/feature-provider-flagsmith-sdk-upgrade branch from 604822d to fc3f68f Compare August 12, 2025 08:39
@Zaimwa9
Copy link
Contributor Author

Zaimwa9 commented Aug 21, 2025

Bringing this one to your attention @thomaspoignant :)
Should be in its final state

@thomaspoignant
Copy link
Member

Hey @Zaimwa9 I am not sure why it was assigned to me (since I am not super knowledgeable of flagsmith).
Maybe @dabeeeenster can help us to find who can review this?

@thomaspoignant thomaspoignant removed their request for review August 26, 2025 08:04
@thomaspoignant thomaspoignant removed their assignment Aug 26, 2025
@beeme1mr beeme1mr requested a review from matthewelwell August 29, 2025 15:15
@beeme1mr beeme1mr changed the title chore(flagsmith): upgrade-provider-to-latest-flagsmith-client-version feat(flagsmith): upgrade-provider-to-latest-flagsmith-client-version Aug 29, 2025
@beeme1mr
Copy link
Member

Hey @Zaimwa9, I updated the title to a feat because it will trigger a version bump and be included in the release notes. I'll wait for @matthewelwell or @dabeeeenster from Flagsmith to give the final approval. Thanks for the PR!

@Zaimwa9
Copy link
Contributor Author

Zaimwa9 commented Sep 5, 2025

@beeme1mr thanks for the review! I'm working at flagsmith as a disclaimer 😄. We will major the sdk soon (with no impact here) so I will delay this PR until we do if that's ok for you -and have the CI passing by then!-

…into chore/feature-provider-flagsmith-sdk-upgrade
@Zaimwa9
Copy link
Contributor Author

Zaimwa9 commented Sep 16, 2025

@beeme1mr , if that's ok, we will stick to this version for now as the major is delayed. So this one is ready to be merged. Thanks again for your help, I appreciate

@beeme1mr beeme1mr merged commit 35d4653 into open-feature:main Sep 16, 2025
4 of 7 checks passed
Zaimwa9 added a commit to Flagsmith/js-sdk-contrib that referenced this pull request Sep 25, 2025
…pen-feature#1362)

Signed-off-by: wadii <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: wadii <[email protected]>
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.

4 participants