Skip to content

Conversation

@leoromanovsky
Copy link
Collaborator

@leoromanovsky leoromanovsky commented Nov 3, 2025

Motivation

Server SDKs are not using the json:api wrapper; sync'ing this repo with the test files in system-tests to help migration.

Changes

  • removes the jsonapi wrapper
  • drops *Response object
  • no content or test changes

Test instructions

Checklist

  • Updated Documentation
  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@leoromanovsky leoromanovsky marked this pull request as ready for review November 3, 2025 21:44
@leoromanovsky leoromanovsky requested a review from a team as a code owner November 3, 2025 21:44
@leoromanovsky leoromanovsky reopened this Nov 3, 2025
* fix: resolve falsy value assignment bugs in FFE evaluation

Fixes critical bugs that prevented proper handling of falsy values in flag assignments:

1. Bug #1: Fixed variant existence check in evaluateForSubject.ts
   - Changed `if (variant)` to `if (variant != null)` on line 78
   - Ensures boolean false, integer 0, and empty string values are returned correctly
   - Previously, truthy check would incorrectly skip returning legitimate falsy flag values

2. Bug #2: Fixed cache entry validation in local-storage-assignment-cache.ts
   - Changed `if (key && value)` to `if (key != null && value != null)` on line 16
   - Ensures cache entries with falsy values are stored properly
   - Prevents exposure event deduplication issues

These fixes resolve the failing test cases:
- test-case-boolean-false-assignment.json (boolean false values)
- test-case-empty-string-variation.json (empty string values)
- test-case-falsy-value-assignments.json (integer zero values)

* add new test cases locally

* match format
@leoromanovsky
Copy link
Collaborator Author

I had stacked the fixes (8792b08) because the test files were not in json:api format; they are rectified here.

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.

3 participants