Skip to content

'assertion failed: !event.matches()' hits erratically for some users. Should this actually be an assertion? #2597

@maximetinu

Description

@maximetinu

Hi everybody! 👋

in the app I'm working at, we have an erratic crash since long ago where this assert is being hit randomly, only for some users, upon resizing the browser window of a wasm browser game that uses winit and glutin. We still didn't manage to narrow it down or reproduce it consistently for all kinds of clients, but looking at the code where this assertion is called, it seems to me that it might not be needed.

This is how this error looks (for the sake of Google indexing, just in case someone else finds it):

panicked at 'assertion failed: !event.matches()', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\web\web_sys\scaling.rs:74:9

or, in previous versions:

panicked at 'assertion failed: `(left == right)`
  left: `true`,
  right: `false`', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\web\web_sys\scaling.rs:74:9

I pinged the original author, @alvinhochun, to ask about this (here) and it seems that, I quote:

removing this assert should be perfectly fine because it is recoverable

So that's what I'm going to do. I plan on opening a PR for that if no one objects.

Does this sound familiar to anyone? Any further ideas are welcome 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedDS - webAffects the Web backend (WebAssembly/WASM)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions