@@ -41,7 +41,7 @@ module LaunchDarkly
41
41
output = flush_and_get_events ( ep , sender )
42
42
expect ( output ) . to contain_exactly (
43
43
eq ( index_event ( default_config , context ) ) ,
44
- eq ( feature_event ( flag , context , 1 , 'value' ) ) ,
44
+ eq ( feature_event ( default_config , flag , context , 1 , 'value' ) ) ,
45
45
include ( :kind => "summary" )
46
46
)
47
47
end
@@ -69,7 +69,7 @@ module LaunchDarkly
69
69
output = flush_and_get_events ( ep , sender )
70
70
expect ( output ) . to contain_exactly (
71
71
eq ( index_event ( default_config , context ) ) ,
72
- eq ( feature_event ( flag , context , 1 , 'value' ) )
72
+ eq ( feature_event ( default_config , flag , context , 1 , 'value' ) )
73
73
)
74
74
end
75
75
end
@@ -83,7 +83,7 @@ module LaunchDarkly
83
83
output = flush_and_get_events ( ep , sender )
84
84
expect ( output ) . to contain_exactly (
85
85
eq ( index_event ( config , context ) ) ,
86
- eq ( feature_event ( flag , context , 1 , 'value' ) ) ,
86
+ eq ( feature_event ( config , flag , context , 1 , 'value' ) ) ,
87
87
include ( :kind => "summary" )
88
88
)
89
89
end
@@ -98,7 +98,7 @@ module LaunchDarkly
98
98
output = flush_and_get_events ( ep , sender )
99
99
expect ( output ) . to contain_exactly (
100
100
eq ( index_event ( config , context ) ) ,
101
- eq ( feature_event ( flag , context , 1 , 'value' ) ) ,
101
+ eq ( feature_event ( config , flag , context , 1 , 'value' ) ) ,
102
102
include ( :kind => "summary" )
103
103
)
104
104
end
@@ -142,7 +142,7 @@ module LaunchDarkly
142
142
output = flush_and_get_events ( ep , sender )
143
143
expect ( output ) . to contain_exactly (
144
144
eq ( index_event ( default_config , context ) ) ,
145
- eq ( feature_event ( flag , context , 1 , 'value' ) ) ,
145
+ eq ( feature_event ( default_config , flag , context , 1 , 'value' ) ) ,
146
146
eq ( debug_event ( default_config , flag , context , 1 , 'value' ) ) ,
147
147
include ( :kind => "summary" )
148
148
)
@@ -207,8 +207,8 @@ module LaunchDarkly
207
207
output = flush_and_get_events ( ep , sender )
208
208
expect ( output ) . to contain_exactly (
209
209
eq ( index_event ( default_config , context ) ) ,
210
- eq ( feature_event ( flag1 , context , 1 , 'value' , starting_timestamp ) ) ,
211
- eq ( feature_event ( flag2 , context , 1 , 'value' , starting_timestamp + 1 ) ) ,
210
+ eq ( feature_event ( default_config , flag1 , context , 1 , 'value' , starting_timestamp ) ) ,
211
+ eq ( feature_event ( default_config , flag2 , context , 1 , 'value' , starting_timestamp + 1 ) ) ,
212
212
include ( :kind => "summary" )
213
213
)
214
214
end
@@ -624,18 +624,20 @@ def identify_event(config, context, timestamp = starting_timestamp)
624
624
end
625
625
626
626
#
627
+ # @param config [Config]
627
628
# @param flag [Hash]
628
629
# @param context [LDContext]
629
630
# @param variation [Integer]
630
631
# @param value [any]
631
632
# @param timestamp [Integer]
632
633
# @return [Hash]
633
634
#
634
- def feature_event ( flag , context , variation , value , timestamp = starting_timestamp )
635
+ def feature_event ( config , flag , context , variation , value , timestamp = starting_timestamp )
636
+ context_filter = Impl ::ContextFilter . new ( config . all_attributes_private , config . private_attributes )
635
637
out = {
636
638
kind : 'feature' ,
637
639
creationDate : timestamp ,
638
- contextKeys : context . keys ,
640
+ context : context_filter . filter ( context ) ,
639
641
key : flag [ :key ] ,
640
642
variation : variation ,
641
643
version : flag [ :version ] ,
0 commit comments