openleadr-python
openleadr-python copied to clipboard
Fixed problem with removing events during clean up
In the client's _event_cleanup
popping items during iteration could cause missing events if two adjacent events in the list are to be removed. Iterating in reverse fixes this issue.
Unfortunately, I could not add a test as I did not find any example setups for such a scenario and I am not very familiar with the framework to implement one myself.
Thanks for the contribution and the fix! I'll check it out once I get to it and maybe write a test or two for it as well.