diff --git a/ldclient/client.py b/ldclient/client.py index ac087c4d..825d542c 100644 --- a/ldclient/client.py +++ b/ldclient/client.py @@ -397,7 +397,7 @@ def all_flags_state(self, user, **kwargs): if client_only and not flag.get('clientSide', False): continue try: - detail = evaluate(flag, user, self._store, False).detail + detail = evaluate(flag, user, self._store, self._event_factory_default).detail state.add_flag(flag, detail.value, detail.variation_index, detail.reason if with_reasons else None, details_only_if_tracked) except Exception as e: diff --git a/ldclient/event_processor.py b/ldclient/event_processor.py index 5a532861..f66e0e57 100644 --- a/ldclient/event_processor.py +++ b/ldclient/event_processor.py @@ -259,7 +259,7 @@ def _process_event(self, event): add_debug_event = False add_index_event = False if event['kind'] == "feature": - add_full_event = event['trackEvents'] + add_full_event = event.get('trackEvents') add_debug_event = self._should_debug_event(event) else: add_full_event = True diff --git a/ldclient/event_summarizer.py b/ldclient/event_summarizer.py index c0aa5aeb..e046a347 100644 --- a/ldclient/event_summarizer.py +++ b/ldclient/event_summarizer.py @@ -20,7 +20,7 @@ def __init__(self): """ def summarize_event(self, event): if event['kind'] == 'feature': - counter_key = (event['key'], event['variation'], event['version']) + counter_key = (event['key'], event.get('variation'), event.get('version')) counter_val = self.counters.get(counter_key) if counter_val is None: counter_val = { 'count': 1, 'value': event['value'], 'default': event.get('default') }