@@ -41,7 +41,7 @@ module LaunchDarkly
4141 output = flush_and_get_events ( ep , sender )
4242 expect ( output ) . to contain_exactly (
4343 eq ( index_event ( default_config , context ) ) ,
44- eq ( feature_event ( flag , context , 1 , 'value' ) ) ,
44+ eq ( feature_event ( default_config , flag , context , 1 , 'value' ) ) ,
4545 include ( :kind => "summary" )
4646 )
4747 end
@@ -69,7 +69,7 @@ module LaunchDarkly
6969 output = flush_and_get_events ( ep , sender )
7070 expect ( output ) . to contain_exactly (
7171 eq ( index_event ( default_config , context ) ) ,
72- eq ( feature_event ( flag , context , 1 , 'value' ) )
72+ eq ( feature_event ( default_config , flag , context , 1 , 'value' ) )
7373 )
7474 end
7575 end
@@ -83,7 +83,7 @@ module LaunchDarkly
8383 output = flush_and_get_events ( ep , sender )
8484 expect ( output ) . to contain_exactly (
8585 eq ( index_event ( config , context ) ) ,
86- eq ( feature_event ( flag , context , 1 , 'value' ) ) ,
86+ eq ( feature_event ( config , flag , context , 1 , 'value' ) ) ,
8787 include ( :kind => "summary" )
8888 )
8989 end
@@ -98,7 +98,7 @@ module LaunchDarkly
9898 output = flush_and_get_events ( ep , sender )
9999 expect ( output ) . to contain_exactly (
100100 eq ( index_event ( config , context ) ) ,
101- eq ( feature_event ( flag , context , 1 , 'value' ) ) ,
101+ eq ( feature_event ( config , flag , context , 1 , 'value' ) ) ,
102102 include ( :kind => "summary" )
103103 )
104104 end
@@ -142,7 +142,7 @@ module LaunchDarkly
142142 output = flush_and_get_events ( ep , sender )
143143 expect ( output ) . to contain_exactly (
144144 eq ( index_event ( default_config , context ) ) ,
145- eq ( feature_event ( flag , context , 1 , 'value' ) ) ,
145+ eq ( feature_event ( default_config , flag , context , 1 , 'value' ) ) ,
146146 eq ( debug_event ( default_config , flag , context , 1 , 'value' ) ) ,
147147 include ( :kind => "summary" )
148148 )
@@ -207,8 +207,8 @@ module LaunchDarkly
207207 output = flush_and_get_events ( ep , sender )
208208 expect ( output ) . to contain_exactly (
209209 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 ) ) ,
212212 include ( :kind => "summary" )
213213 )
214214 end
@@ -624,18 +624,20 @@ def identify_event(config, context, timestamp = starting_timestamp)
624624 end
625625
626626 #
627+ # @param config [Config]
627628 # @param flag [Hash]
628629 # @param context [LDContext]
629630 # @param variation [Integer]
630631 # @param value [any]
631632 # @param timestamp [Integer]
632633 # @return [Hash]
633634 #
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 )
635637 out = {
636638 kind : 'feature' ,
637639 creationDate : timestamp ,
638- contextKeys : context . keys ,
640+ context : context_filter . filter ( context ) ,
639641 key : flag [ :key ] ,
640642 variation : variation ,
641643 version : flag [ :version ] ,
0 commit comments