Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eppo/js-client-sdk-common",
"version": "4.13.0",
"version": "4.13.1",
"description": "Common library for Eppo JavaScript SDKs (web, react native, and node)",
"main": "dist/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/client/eppo-precomputed-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export default class EppoPrecomputedClient {

if (banditEvaluation == null) {
logger.warn(`${loggerPrefix} No assigned variation. Bandit not found: ${flagKey}`);
return { variation: defaultValue, action: null };
return { variation: this.getStringAssignment(flagKey, defaultValue), action: null };
Copy link
Member

Choose a reason for hiding this comment

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

Did you consider adding a test for this situation?

Copy link
Contributor

Choose a reason for hiding this comment

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

For precomputed, I think the change should be made the edge compute method, not this client.

Basically, part of the edge compute logic should be evaluating a bandit flag whether it has an active bandit allocation or not--not the responsibility of the downstream client.

For null, we'd do the same as getPrecomputedAssignment(), and do a check like:

if (assignedVariation == null) {
  logger.warn(`[Eppo SDK] No assigned variation. Bandit flag not found: ${flagKey}`);
  return defaultValue;
}

But otherwise would expect something in the format { variation: <variation to return>, action: null} in that case

}

const assignedVariation = this.getStringAssignment(flagKey, defaultValue);
Expand Down
Loading