Skip to content

Conversation

@ZamoraEmmanuel
Copy link
Contributor

JavaScript commons library

What did you accomplish?

How do we test the changes introduced in this PR?

Extra Notes

@ZamoraEmmanuel ZamoraEmmanuel requested a review from a team as a code owner October 20, 2025 22:43
splitName: string,
attributes: SplitIO.Attributes | undefined,
storage: IStorageSync | IStorageAsync,
fallbackTreatmentsCalculator: FallbackTreatmentsCalculator,
Copy link
Contributor

Choose a reason for hiding this comment

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

We should move where the fallbackTreatmentsCalculator is called, to contemplate other cases of CONTROL treatments:

  • SDK is not ready
  • SDK is destroyed
  • getTreatment arguments are invalid

For the 1st, we should call the calculator in the client.ts file. For example, in the wrapUp functions.

For the 2nd and 3rd case, we should call the calculator in the clientInputValidation.ts file. For example, inside the wrapResult function if possible, to have the logic in a single place.

This way, we don't need to call the calculator in the evaluator/index.ts file, and probably all updates in the evaluator folder (except the fallbackTreatmentsCalculator subfolder) can be rolled back to simplify the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good Emi, thanks for the feedback! I am closing this pr and develop that approach in this new PR

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.

2 participants