Hanabi-Live / hanabi-live

A web server that allows people to play Hanab, a cooperative card game of logic and reasoning.
https://hanab.live
GNU General Public License v3.0
179 stars 118 forks source link

TypeScript error: "Failed to get the previously known card identity for card: 45" #2894

Closed JelleZijlstra closed 5 months ago

JelleZijlstra commented 11 months ago

I got a TypeScript error on the last play in sudoku + dark null.

TypeError: Failed to get the previously known card identity for card: 45
    at Se (https://hanab.live/public/js/bundles/main.6089.min.js:1:46727)
    at Pa.getCardIdentity (https://hanab.live/public/js/bundles/main.6089.min.js:15:25033)
    at Pa.setBareImage (https://hanab.live/public/js/bundles/main.6089.min.js:15:24442)
    at um (https://hanab.live/public/js/bundles/main.6089.min.js:183:17021)
    at Object.AE [as onChange] (https://hanab.live/public/js/bundles/main.6089.min.js:183:19274)
    at i (https://hanab.live/public/js/bundles/main.6089.min.js:183:14083)
    at Object.C [as dispatch] (https://hanab.live/public/js/bundles/main.6089.min.js:172:28786)
    at https://hanab.live/public/js/bundles/main.6089.min.js:198:9443
    at Object.finishOngoingGame (https://hanab.live/public/js/bundles/main.6089.min.js:198:19908)
    at cR.onMessage (https://hanab.live/public/js/bundles/main.6089.min.js:172:27203)
Screenshot 2023-12-03 at 8 01 47 PM
Zamiell commented 11 months ago

what was the game id?

JelleZijlstra commented 11 months ago

1072518

argothiel commented 11 months ago

image

Today's error, game 1074188.

argothiel commented 11 months ago

Another one today: image

Game 1074353.

argothiel commented 11 months ago

And during the hypo: image Game 1074394.

argothiel commented 11 months ago

Today game. image

Game 1074502.

argothiel commented 11 months ago

image

Game 1075985.

argothiel commented 11 months ago

Is this a duplicate of #2876?

Zamiell commented 11 months ago

ok Rama has been working on this.

today we added new error messages for when the deck gets out of sync.

@argothiel let me know if you get any new error messages lately, and hopefully with the steps to recreate the error message from scratch

argothiel commented 11 months ago

I didn't get any new messages right after the game recently. I got the "A hypoBack action was dispatched with a null hypothetical state" during the hypo, but that might be unrelated.

kesslermaximilian commented 11 months ago

Not the exact same error, but I just got this stacktrace while watching a 2p-NoVar game. I did not take any special actions except spectating. image

Clear Stacktrace:

TypeError: Failed to get card of order 15 from the deck.
    at ve (https://hanab.live/public/js/bundles/main.6226.min.js:5:285677)
    at si (https://hanab.live/public/js/bundles/main.6226.min.js:32:65293)
    at hV (https://hanab.live/public/js/bundles/main.6226.min.js:34:41438)
    at go (https://hanab.live/public/js/bundles/main.6226.min.js:34:40954)
    at https://hanab.live/public/js/bundles/main.6226.min.js:34:41028
    at qi.finishedTweening (https://hanab.live/public/js/bundles/main.6226.min.js:34:24302)
    at Object.onFinish (https://hanab.live/public/js/bundles/main.6226.min.js:13:97737)
    at e.onFinish (https://hanab.live/public/js/bundles/main.6226.min.js:13:95813)
    at tween.onFinish (https://hanab.live/public/js/bundles/main.6226.min.js:12:122920)
    at e.fire (https://hanab.live/public/js/bundles/main.6226.min.js:12:119021)

Since NoVar clearly has at least 16 cards in the deck, there is probably some race condition going on, i.e. the deck has not been updated yet, but the client already wanted to access the card in the deck? I would say the error occurred around a time where card 15 (= the 16th card in the deck) was drawn, so this could be the problem here. But I cannot say for sure if this was the case.

Potentially relevant: While looking at this error message, the game review continued working properly in the background, and the top card of the stacks was always visible, i.e. it showed the full-empathy version of the top card of the stacks. So I could also imagine that the client somehow went off-sync with where the game progress/cards are and that there is an indirect off-by-one in here.

Zamiell commented 11 months ago

Yeah I think that is a separate issue, it looks like your internet lagged and you got an action out of order. This kind of thing isn't supposed to happen since WebSocket can't deliver messages out of order.

Zamiell commented 11 months ago

The stack trace isn't interesting, I'd be interested in seeing what were the actions received by the server before and after the error message.

Zamiell commented 5 months ago

should be fixed in https://github.com/Hanabi-Live/hanabi-live/commit/872253e896de578e1526ad337414d0fbe4837576