Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when using mouse's forward/backward navigation keys #1628

Open
ZelimDamian opened this issue Feb 26, 2024 · 7 comments · May be fixed by #1631
Open

Crash when using mouse's forward/backward navigation keys #1628

ZelimDamian opened this issue Feb 26, 2024 · 7 comments · May be fixed by #1631
Assignees
Labels
Crash A panic which crashed the editor Good First Issue Good for newcomers Rust Involves Rust programming for the backend

Comments

@ZelimDamian
Copy link

ZelimDamian commented Feb 26, 2024

Steps To Reproduce
Describe precisely how the crash occurred, step by step, starting with a new editor window.

  1. Open the Graphite editor at https://editor.graphite.rs
  2. Open a new document
  3. 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)
@0HyperCube 0HyperCube added Good First Issue Good for newcomers Rust Involves Rust programming for the backend Crash A panic which crashed the editor labels Feb 26, 2024
@0HyperCube
Copy link
Member

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.

@Keavon
Copy link
Member

Keavon commented Feb 28, 2024

@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?

@0HyperCube
Copy link
Member

I can trivially reproduce in chrome. Perhaps you should try pressing the forwards button with the viewport selected in a new document?

@ZelimDamian
Copy link
Author

@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.

@Keavon
Copy link
Member

Keavon commented Feb 28, 2024

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.

@Keavon Keavon changed the title [Crash Report] Invalid modifier keys Crash when using mouse's forward/backward navigation keys Feb 28, 2024
@Keavon Keavon modified the milestone: Sprint 34 Feb 28, 2024
@Keavon
Copy link
Member

Keavon commented Feb 28, 2024

@skoriop please comment here so I can assign you to this issue.

@skoriop
Copy link
Contributor

skoriop commented Feb 28, 2024

sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crash A panic which crashed the editor Good First Issue Good for newcomers Rust Involves Rust programming for the backend
Projects
Status: In-Progress Tasks
Development

Successfully merging a pull request may close this issue.

4 participants