Skip to content

EventManager can miss sending events to handlers #2031

@myk002

Description

@myk002

If a handler is registered to an event
And the requested frequency is different from the requested frequency of an existing handler on that event
And there is state kept between invocations of the event triggering code
Then a handler can miss events that it should receive

An example is manageNewUnitActiveEvent at

static void manageNewUnitActiveEvent(color_ostream& out) {

It will check for new units and send events to handlers whose "cool down" timer has expired. Handlers that have had an event fire too recently (according to their freq value) will not get an event fired. This is working as intended.

However, when manageNewUnitActiveEvent finishes looping through the handlers, it marks all currently active units as processed. Therefore, the handlers that were not sent an event for the detected new units will never get an event for those units.

In order to continue to support different freq values for different handlers, this issue will need to be solved. Otherwise, we should revert back to the previous behavior of all handlers effectively having the lowest requested freq value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    develop onlySpecific to current development (not stable) builds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions