mtgred / netrunner

http://www.jinteki.net
Other
887 stars 389 forks source link

black screen when clicking on play due to game time computation error #7508

Closed acollign closed 2 months ago

acollign commented 3 months ago

There is a situation when clicking on play triggers a black screen. This issue can be reproduced with a recent version (commit 14486e) on Chromium and Firefox as follows:

TypeError: startInclusive.until is not a function
    at Duration.between (js-joda.js:514:35)
    at Function.eval [as cljs$core$IFn$_invoke$arity$variadic] (core.cljs:542:30)
    at Object.cljc$java_time$duration$between [as between] (duration.cljs:34:242)
    at Object.nr$game_row$time_since [as time_since] (game_row.cljs:145:15)
    at cmp.nr$game_row$game_time [as reagentRender] (game_row.cljs:152:25)
    at eval (component.cljs:87:28)
    at Object.reagent$impl$component$wrap_render [as wrap_render] (component.cljs:91:31)
    at Object.reagent$impl$component$do_render [as do_render] (component.cljs:117:6)
    at eval (component.cljs:260:64)
    at Object.reagent$ratom$in_context [as in_context] (ratom.cljs:44:6)
NBKelly commented 3 months ago

Hi, does your build include #7501?

I believe that one should fix it.

acollign commented 3 months ago

Hi, does your build include #7501

@NBKelly , yes it does. My branch contains the commit 5d514f.

It is very odd. Today, I could reproduce this at least 10 times in a row locally and someone reported the same on another instance.

NBKelly commented 3 months ago

Ok, I think I figured it out. I'll link in a PR in a second. nevermind, I'm getting tricked by a very subtle issue which I think also make my previous fix invalid (reloading lobby.clj makes the issue disappear) I'm still working on it though.

acollign commented 3 months ago

nevermind, I'm getting tricked by a very subtle issue which I think also make my previous fix invalid (reloading lobby.clj makes the issue disappear)

I did see the same during my development. It is very odd. It looks like sometimes the time value is not of the right type. I was not able to find the root cause, yet.

I'm still working on it though.

Thank you so much. Let me know if I can help with debugging or reproducing. I will be available on Sunday.

NBKelly commented 3 months ago

Hi, I still don't understand the actual issue, but my current working fix is here: #7511. Give that one a try and see how it goes.

acollign commented 3 months ago

I found out today that the following error fires as well when hitting the problem. It's unclear to me which factor is causing the other.

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
cmp@http://localhost:1042/js/cljs-runtime/reagent.impl.component.js:499:43
div
cmp@http://localhost:1042/js/cljs-runtime/reagent.impl.component.js:499:43
div
cmp@http://localhost:1042/js/cljs-runtime/reagent.impl.component.js:499:43
div
cmp@http://localhost:1042/js/cljs-runtime/reagent.impl.component.js:499:43
cmp@http://localhost:1042/js/cljs-runtime/reagent.impl.component.js:499:43
div
div
cmp@http://localhost:1042/js/cljs-runtime/reagent.impl.component.js:499:43
cmp@http://localhost:1042/js/cljs-runtime/reagent.impl.component.js:499:43
div
div
cmp@http://localhost:1042/js/cljs-runtime/reagent.impl.component.js:499:43
cmp@http://localhost:1042/js/cljs-runtime/reagent.impl.component.js:499:43
cmp@http://localhost:1042/js/cljs-runtime/reagent.impl.component.js:499:43

See screenshot for the full stacktrace

react-update-umounted-comp