Skip to content

Conversation

@luke-belton
Copy link

Bring this in line with other SDKs by setting a locally_evaluated property on $feature_flag_called events to indicate whether the flag was evaluated locally.

Comment on lines +1019 to +1034
lastEvent := client.GetLastCapturedEvent()
if lastEvent == nil || lastEvent.Event != "$feature_flag_called" {
t.Errorf("Expected a $feature_flag_called event, got: %v", lastEvent)
}

if lastEvent != nil {
if lastEvent.Properties["$feature_flag"] != "test-get-feature" {
t.Errorf("Expected feature flag key 'test-get-feature', got: %v", lastEvent.Properties["$feature_flag"])
}
if lastEvent.Properties["$feature_flag_response"] != "variant-1" {
t.Errorf("Expected feature flag response 'variant-1', got: %v", lastEvent.Properties["$feature_flag_response"])
}
if lastEvent.Properties["locally_evaluated"] != true {
t.Errorf("Expected locally_evaluated to be true for local evaluation, got: %v", lastEvent.Properties["locally_evaluated"])
}
}
Copy link
Author

Choose a reason for hiding this comment

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

my local eval tests didn't seem to be working locally, so not sure about this 🤔

@luke-belton luke-belton marked this pull request as draft October 30, 2025 17:26
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