0xFableOrg / 0xFable

A fully on-chain trading card game. There will be elves, wizards & shit. Drama and broken friendships also.
https://twitter.com/0xFableGame
BSD 3-Clause Clear License
103 stars 35 forks source link

Fix join game flow race condition (regression) #123

Open norswap opened 5 months ago

norswap commented 5 months ago

There seems to be a regression whereas if both player send their drawInitialHand transaction at the same time there is a race condition (which is also not resolved by resending the transaction, though possible that's because of client-side caching of the drawn cards?).

This didn't used to be the case (I tested this explicitly).

In particular, I'm having an easy time triggering this by creating a game in browser 1 (firefox), joining with browser 2 (chrome) then immediately going back to browser 1 and joining too.

This was discovered while reviewing #107 (but mostly likely isn't the cause).

First order of business should be to figure out what introduced this regression. Could it be the contract refactor? Some more recent frontend changes, however unlikely?