From 61a62912e493a2279ae75d1482e45633a8dc7159 Mon Sep 17 00:00:00 2001 From: Stan Janssen Date: Mon, 12 Feb 2024 17:31:17 +0100 Subject: [PATCH] Correct behavior when receiving response to completed events --- openleadr/service/event_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openleadr/service/event_service.py b/openleadr/service/event_service.py index 169ecd6..23eae14 100644 --- a/openleadr/service/event_service.py +++ b/openleadr/service/event_service.py @@ -46,6 +46,10 @@ async def request_event(self, payload): event_status = utils.getmember(event, 'event_descriptor.event_status') # Pop the event from the events so that this is the last time it is communicated if event_status == enums.EVENT_STATUS.COMPLETED: + if ven_id not in self.completed_event_ids: + self.completed_event_ids[ven_id] = [] + event_id = utils.getmember(event, 'event_descriptor.event_id') + self.completed_event_ids[ven_id].append(event_id) self.events[ven_id].pop(self.events[ven_id].index(event)) else: events = None