Crash when using mouse's forward/backward navigation keys
Steps To Reproduce Describe precisely how the crash occurred, step by step, starting with a new editor window.
- Open the Graphite editor at https://editor.graphite.rs
- Open a new document
- Press the forward or backward navigation buttons (if present on your mouse)
Browser and OS Chrome 121, Windows 10 or 11
Stack Trace Copied from the crash dialog in the Graphite editor:
panicked at editor/src/messages/input_mapper/utility_types/input_mouse.rs:122:53:
Invalid modifier keys
Error
at https://editor.graphite.rs/assets/index-0dfa4520.js:27:1143
at g (https://editor.graphite.rs/assets/index-0dfa4520.js:15:33449)
at Object.handleJsMessage (https://editor.graphite.rs/assets/index-0dfa4520.js:15:33597)
at https://editor.graphite.rs/assets/index-0dfa4520.js:16:34409
at https://editor.graphite.rs/assets/index-0dfa4520.js:16:30846
at gt (https://editor.graphite.rs/assets/index-0dfa4520.js:16:1233)
at C1.o.wbg.__wbg_call_4c92f6aec1e1d6e6 (https://editor.graphite.rs/assets/index-0dfa4520.js:16:30812)
at https://editor.graphite.rs/assets/graphite_wasm_bg-8d0b74aa.wasm:wasm-function[1938]:0x475594
at https://editor.graphite.rs/assets/graphite_wasm_bg-8d0b74aa.wasm:wasm-function[4486]:0x57c6b8
at https://editor.graphite.rs/assets/graphite_wasm_bg-8d0b74aa.wasm:wasm-function[4052]:0x560fe9
at https://editor.graphite.rs/assets/graphite_wasm_bg-8d0b74aa.wasm:wasm-function[6577]:0x5fb948
at https://editor.graphite.rs/assets/graphite_wasm_bg-8d0b74aa.wasm:wasm-function[5705]:0x5aee8d
at https://editor.graphite.rs/assets/graphite_wasm_bg-8d0b74aa.wasm:wasm-function[6391]:0x5f82e4
at https://editor.graphite.rs/assets/graphite_wasm_bg-8d0b74aa.wasm:wasm-function[3822]:0x550f2a
at qn.onMouseMove (https://editor.graphite.rs/assets/index-0dfa4520.js:16:4836)
at w (https://editor.graphite.rs/assets/index-0dfa4520.js:19:2579)
at action (https://editor.graphite.rs/assets/index-0dfa4520.js:19:415)
Thanks for reporting @ZelimDamian. This can be reproduced by pressing the browser back or forwards button in chrome (not in firefox) - this is because it reports a mouse button event which cannot be interpreted - https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#value.
To fix, the back and forward buttons could be added to the ModifierKeys struct.
@0HyperCube I can't reproduce this in Chrome. I was wondering how you came to the conclusion that this issue report arises from the browser forward/backward keys, if OP didn't fill out the bug report with any details like reproduction steps?
I can trivially reproduce in chrome. Perhaps you should try pressing the forwards button with the viewport selected in a new document?
@Keavon Sorry for the poor details in the issue report but there weren't any other steps really originally. I just opened the window and clicked on New document and error showed up.
Now that I'm testing it it doesn't happen when just opening a new document but clicking on the Back/Forward buttons on my mouse (even when there is no history to navigate) causes an error.
Ok, yeah, I can get it to happen with the mouse button. I misinterpreted @0HyperCube's first comment thinking he meant the back/forward buttons in the browser's UI. I can reproduce this trivially with the mouse buttons. I'll update the issue details with that in mind, and I agree with Hypercube's point about adding those buttons which will be necessary for #706.
@skoriop please comment here so I can assign you to this issue.
sure!