Skip to content

Conversation

@leoromanovsky
Copy link
Member

Adds test case to validate SDK behavior when subject key is an empty string. It tests whether SDKs should accept empty string as a valid subject identifier.

Test validates:

  • Empty string subject can get legitimate assignments (not just defaults)
  • Normal subjects with real keys continue to work
  • Proper default fallback when no rules match

Adds test case to validate SDK behavior when subject key is an empty string.
This is a separate policy decision from the falsy value assignment bug - it
tests whether SDKs should accept empty string as a valid subject identifier.

Test validates:
- Empty string subject can get legitimate assignments (not just defaults)
- Normal subjects with real keys continue to work
- Proper default fallback when no rules match
@leoromanovsky leoromanovsky marked this pull request as ready for review November 3, 2025 18:35
Copy link
Contributor

@aarsilv aarsilv left a comment

Choose a reason for hiding this comment

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

Nice! Approving as-is, with a request to expand the test to test for empty-string-valued attributes (if we're not yet already testing those)

"defaultValue": true,
"subjects": [
{
"subjectKey": "",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

"attribute": "user_type",
"operator": "ONE_OF",
"value": [
"anonymous"
Copy link
Contributor

Choose a reason for hiding this comment

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

This reminds me, if we are not already, we should have these tests check to make sure ONE_OF and NOT_ONE_OF work as expected with empty string values.

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