Skip to content

Is the "event not consumed" warning spurious? #6596

@alice-i-cecile

Description

@alice-i-cecile

Discussed in #6595

Originally posted by nicopap November 13, 2022

Missed 31 `bevy_input::mouse::MouseMotion` events. Consider
reading from the `EventReader` more often (generally the best
solution) or calling Events::update() less frequently
(normally this is called once per frame). This problem is most
likely due to run criteria/fixed timesteps or consuming events
conditionally. See the Events documentation for
more information.

Live example: https://nicopap.github.io/bevy_mod_paramap/earth3d.html (open console, drag around the glob by holding middle click down)

Source code is: https://github.com/nicopap/bevy_mod_paramap/blob/7c5d9789ddd3cb05eb1b023cc0bab0aa5cfa021c/examples/earth3d.rs#L232-L308

I'm getting a warning when I'm doing something quite normal. I just do not read the MouseMotion event when I don't need to.

The error says This problem is […] due to […] consuming events conditionally but fails to explain why it is an issue. Looking at the Events doc, I don't see much of an argument against reading events conditionally.

It feels like a very common false positive. This is very confusing to a new user, especially given most of the warning message doesn't at all match what I'm actually doing in my code. In fact I do often skip reading events when I don't need to read them (for performance!) and I've seen this error in a lot of my projects.

I understand why it can help, but did we not forget to weight the cost of false positives when adding this feature? The likely thing I'll do next time I see this error is to just ignore it, and it might as well not exist in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions