Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong parsing datafile for segments if defined as pure string #61

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

polok
Copy link
Contributor

@polok polok commented Jan 9, 2024

Background

Targeting your audience is one of the most important things when rolling out features. You can do that with segments - https://featurevisor.com/docs/features/#segments

The issue

The segment can be defined like "segments": "SEGMENT_NAME" what was causing an issue with datafile parsing.

The fix

Such pure segment string definition is being mapped to GroupSegment.plain("SEGMENT_NAME")

@polok polok requested a review from a team as a code owner January 9, 2024 13:37
Comment on lines +35 to +40
guard
let _ = try? JSONSerialization.jsonObject(with: data, options: .allowFragments)
else {
return .plain(stringifiedGroupSegment)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These lines are the fix

@polok polok merged commit a47d430 into main Jan 9, 2024
1 check passed
@polok polok deleted the fix_plain_segment_name branch January 9, 2024 14:13
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