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

Browser crash #1550

Closed
ctm opened this issue Jan 31, 2025 · 2 comments
Closed

Browser crash #1550

ctm opened this issue Jan 31, 2025 · 2 comments
Assignees
Labels
bug Something isn't working easy Trivial to do (even when tired!) and semi-worthwhile high priority Should be done fairly soon

Comments

@ctm
Copy link
Owner

ctm commented Jan 31, 2025

Find and fix this problem. It's an unwrap() invocation in chat_box

2025-01-29T01:34:25.731602357Z ERROR [mb2::tournament] BrowserError { when: 2025-01-29T01:33:30.536999940Z, which: WindowInfo { href: Ok("https://craftpoker.com/event/5690/player/17"), user_agent: Ok("Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36") }, window: WindowErrorInfo { message: Some("Uncaught RuntimeError: unreachable"), source: Some("https://craftpoker.com/mb2-web.wasm"), line_no: Some(1), col_no: Some(2893448), error: Some(ErrorStrings { cause: "JsValue(undefined)", message: "unreachable", name: "RuntimeError", stack: Some("RuntimeError: unreachable
    at mb2_web.wasm.std::panicking::rust_panic_with_hook::he163a328f096b027 (https://craftpoker.com/mb2-web.wasm:wasm-function[2809]:0x2c2687)
    at mb2_web.wasm.core::panicking::panic_fmt::hf09e831ea9f1651a (https://craftpoker.com/mb2-web.wasm:wasm-function[4868]:0x2fb7ed)
    at mb2_web.wasm.core::panicking::panic::hfef8090705073b49 (https://craftpoker.com/mb2-web.wasm:wasm-function[4367]:0x2f0516)
    at mb2_web.wasm.core::option::unwrap_failed::h2a4bd6bdc836fc39 (https://craftpoker.com/mb2-web.wasm:wasm-function[5541]:0x35425f)
    at mb2_web.wasm.<yew::html::component::lifecycle::CompStateInner<COMP> as yew::html::component::lifecycle::Stateful>::view::hba675e076059123a (https://craftpoker.com/mb2-web.wasm:wasm-function[5292]:0x3163aa)
    at mb2_web.wasm.<yew::html::component::lifecycle::RenderRunner as yew::scheduler::Runnable>::run::hc890ba6cf3c0fbf0 (https://craftpoker.com/mb2-web.wasm:wasm-function[469]:0xd6d08)
    at mb2_web.wasm.yew::scheduler::arch::start::{{closure}}::ha8dde882a81eac30 (https://craftpoker.com/mb2-web.wasm:wasm-function[3536]:0x2d9f88)
    at mb2_web.wasm.wasm_bindgen_futures::queue::QueueState::run_all::h184fcd4d86589088 (https://craftpoker.com/mb2-web.wasm:wasm-function[1517]:0x20aa6b)
    at mb2_web.wasm.wasm_bindgen_futures::queue::Queue::new::{{closure}}::h62a661c190f2c9af (https://craftpoker.com/mb2-web.wasm:wasm-function[5147]:0x307541)
    at mb2_web.wasm (https://craftpoker.com/mb2-web.wasm:wasm-function[6195]:0x370189)") }) }, panic: Some(PanicInfo { reason: Some("called `Option::unwrap()` on a `None` value"), location_info: Some(LocationInfo { file: "front-ends/web/src/table/graphical.rs", line: 133, column: 41 }) }), most_recent_info: Ok(MostRecentMessageAndRequest { message: Some(TimestampedString { when: 2025-01-29T01:33:29.823999881Z, what: "Public(Remind(20000, ChipCount(0), 2025-01-29T01:33:50.203230360Z, PlayerId(13), 20))" }), request: Some(TimestampedString { when: 2025-01-29T01:33:11.894000053Z, what: "SetAction(Some((Fold, ActionSynchronizer(171))))" }) }) }
@ctm ctm added bug Something isn't working easy Trivial to do (even when tired!) and semi-worthwhile high priority Should be done fairly soon labels Jan 31, 2025
@ctm ctm self-assigned this Jan 31, 2025
@ctm
Copy link
Owner Author

ctm commented Jan 31, 2025

Looks like it also got hit here:

2025-01-31T01:05:53.471147900Z ERROR [mb2::tournament] BrowserError { when: 2025-01-31T01:05:29.818000078Z, which: WindowInfo { href: Ok("https://craftpoker.com/event/5692/player/6"), user_agent: Ok("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36") }, window: WindowErrorInfo { message: Some("Uncaught RuntimeError: unreachable"), source: Some("https://craftpoker.com/mb2-web.wasm"), line_no: Some(1), col_no: Some(2893448), error: Some(ErrorStrings { cause: "JsValue(undefined)", message: "unreachable", name: "RuntimeError", stack: Some("RuntimeError: unreachable
    at mb2_web.wasm.std::panicking::rust_panic_with_hook::he163a328f096b027 (https://craftpoker.com/mb2-web.wasm:wasm-function[2809]:0x2c2687)
    at mb2_web.wasm.core::panicking::panic_fmt::hf09e831ea9f1651a (https://craftpoker.com/mb2-web.wasm:wasm-function[4868]:0x2fb7ed)
    at mb2_web.wasm.core::panicking::panic::hfef8090705073b49 (https://craftpoker.com/mb2-web.wasm:wasm-function[4367]:0x2f0516)
    at mb2_web.wasm.core::option::unwrap_failed::h2a4bd6bdc836fc39 (https://craftpoker.com/mb2-web.wasm:wasm-function[5541]:0x35425f)
    at mb2_web.wasm.<yew::html::component::lifecycle::CompStateInner<COMP> as yew::html::component::lifecycle::Stateful>::view::hba675e076059123a (https://craftpoker.com/mb2-web.wasm:wasm-function[5292]:0x3163aa)
    at mb2_web.wasm.<yew::html::component::lifecycle::RenderRunner as yew::scheduler::Runnable>::run::hc890ba6cf3c0fbf0 (https://craftpoker.com/mb2-web.wasm:wasm-function[469]:0xd6d08)
    at mb2_web.wasm.yew::scheduler::arch::start::{{closure}}::ha8dde882a81eac30 (https://craftpoker.com/mb2-web.wasm:wasm-function[3536]:0x2d9f88)
    at mb2_web.wasm.wasm_bindgen_futures::queue::QueueState::run_all::h184fcd4d86589088 (https://craftpoker.com/mb2-web.wasm:wasm-function[1517]:0x20aa6b)
    at mb2_web.wasm.wasm_bindgen_futures::queue::Queue::new::{{closure}}::h62a661c190f2c9af (https://craftpoker.com/mb2-web.wasm:wasm-function[5147]:0x307541)
    at mb2_web.wasm (https://craftpoker.com/mb2-web.wasm:wasm-function[6195]:0x370189)") }) }, panic: Some(PanicInfo { reason: Some("called `Option::unwrap()` on a `None` value"), location_info: Some(LocationInfo { file: "front-ends/web/src/table/graphical.rs", line: 133, column: 41 }) }), most_recent_info: Ok(MostRecentMessageAndRequest { message: Some(TimestampedString { when: 2025-01-31T01:05:29.460000038Z, what: "Public(Dealing(\"200 400 Badeucy\", 3, SplitLimit, Some(7), false, HandId(441053), true, true, 0))" }), request: None }) }

This is the line in question:

                    { self.log.as_ref().unwrap().view(ChatType::Graphical) }

@ctm
Copy link
Owner Author

ctm commented Feb 1, 2025

This is related to the ability to pop-out chat. Basically, the code got into a state where the table had no log, but it still thought chat was docked. This is such a rare bug that I have not yet fixed it so that such a state is unrepresentable, instead I've just gotten rid of the unwrap as follows. I'll create a new issue to solve this correctly.

diff --git a/front-ends/web/src/table/graphical.rs b/front-ends/web/src/table/graphical.rs
index b252ad3b..470471f9 100644
--- a/front-ends/web/src/table/graphical.rs
+++ b/front-ends/web/src/table/graphical.rs
@@ -130,7 +130,14 @@ impl super::Table {
             <>
                 <button class={"chat"}>{ "Chat" }</button>
                 <div class={"chat-and-input"}>
-                    { self.log.as_ref().unwrap().view(ChatType::Graphical) }
+                    {
+                        if let Some(log) = &self.log {
+                            log.view(ChatType::Graphical)
+                        } else {
+                            log::warn!("no log");
+                            html! { }
+                        }
+                    }
                     if !self.is_anon() && self.is_connected() {
                         <div class={"chat-input-graphical"}>
                             { crate::chat_input("chat", &self.chat_box, &onkeyup) }

Deploying now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working easy Trivial to do (even when tired!) and semi-worthwhile high priority Should be done fairly soon
Projects
None yet
Development

No branches or pull requests

1 participant