Page 1 of 1

Bug: client performs game action twice

Posted: 29 August 2020, 21:55
by bmcfluff
Hi, I'm one of the devs for Lost Cities. I'm trying to track down some bugs which all seem to involve the client performing an action twice that it should only perform once. For example, in this image https://imgur.com/gallery/NAwZOIe, you can see that some cards were played twice (yellow 10, white 7) and also that one extra card was drawn from the deck (so the game ends with -1 cards in deck). Importantly, these appear to be entirely client-side display bugs: they don't show up on replay, refreshing the page seems to fix them, the final scores are correct (as if the action had only been performed once), etc. Does anyone have experience tracking down things like this? Is it an issue with my game in particular, or is it a known issue with the larger framework (e.g. sometimes a notification gets sent twice in any game?)

Re: Bug: client performs game action twice

Posted: 29 August 2020, 22:26
by RicardoRix
certainly seems like a doubling of the notification.

it maybe the connection drops may be the cause.
server doesn't think the client received the message so sends it again.

You would think that inside the framework there would be check with a unique id or something to make sure this doesn't happen.

Re: Bug: client performs game action twice

Posted: 30 August 2020, 01:03
by Victoria_La
Check that when client sends ajax action it is locked (lock: true) in args parameters. If action is not locked the client may do something else before server reply is received (it may not necessary work but it will appear as such)

Re: Bug: client performs game action twice

Posted: 31 August 2020, 12:48
by vincentt
Hi

maybe you have two connect on the same components and therefore the connect action is done twice?