~akarle/public-inbox

3 2

Thanks and feedback for euchre-live

Details
Message ID
<20200802220248.38b69efe@mordor>
DKIM signature
fail
Download raw message
DKIM signature: fail
Hi,

I just used http://euchre.live this evening. Thanks for making it!
Overall I thought it worked pretty well. The one bug we ran into very
frequently while playing was that the page would stop updating and could
not perform any actions. I opened dev-tools in my browser while playing
so that I could see if it would say anything when I got disconnected.
Sure enough, the issue appears to be that the WebSocket got closed
somehow, and that any messages sent over the wire could not be sent.

To fix this, I believe you can add a callback whenever the websocket
gets closed; in the callback, you can just try to reconnect. To make the
user-experience better as well, you could show an indication on the page
that the client is currently disconnected.

Would you be interested in a patch to fix this? It might be better if
you fixed it yourself, since you already have the dev environment setup
and know how the project is structured (I've never used Perl before).
Let me know which you would rather.

As a counterpoint to this bug, we were still able to finish both of our
games, since we could just refresh the page and join the game again.

Thanks,
Philip
Details
Message ID
<20200804023253.GA1834@obg.localdomain>
In-Reply-To
<20200802220248.38b69efe@mordor> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
> Hi,

Hello!

> I just used http://euchre.live this evening. Thanks for making it!

Thanks for trying it out! I appreciate the feedback.

> Overall I thought it worked pretty well. The one bug we ran into very
> frequently while playing was that the page would stop updating and could
> not perform any actions. I opened dev-tools in my browser while playing
> so that I could see if it would say anything when I got disconnected.
> Sure enough, the issue appears to be that the WebSocket got closed
> somehow, and that any messages sent over the wire could not be sent.

Thanks for reporting this -- your analysis is spot-on; it was indeed a
websocket closing.

I was mid-typing a lengthy email about why it shouldn't happen (pings
and pongs keep it open, etc) when I reproduced it myself.

As you said, it was super consistent, happening every 10.5 minutes
without fail.

I had migrated recently from Linux+nginx to OpenBSD+relayd as a
OS+reverse proxy combo, so that was the first thing I tried to rule out.

Sure enough, bypassing relayd solved the issue. Digging through the man
pages, I found that there is a default 10 minute session timeout for
existing connections in relayd. Setting that to 20 seconds demonstrated
the same behavior at a faster interval, so I updated it to 2.5 hrs, so
that connections shouldn't drop mid game. So far, I haven't seen any
issues.

> To fix this, I believe you can add a callback whenever the websocket
> gets closed; in the callback, you can just try to reconnect.

I'll ponder this one -- currently we treat all incoming websocket
connections as new players, so the UI would have to do some work with
the backend to rejoin the player (while keeping the ui the same).

> To make the user-experience better as well, you could show an
> indication on the page that the client is currently disconnected.

Great idea, I'll bring it up with my dad (the front end dev).

> Would you be interested in a patch to fix this?

It should be fixed, but I appreciate the offer!

Out of curiousity, how did you find out about the project (if you don't
mind me asking)?

Thanks again,
Alex
Details
Message ID
<20200804090850.5b303da0@mordor>
In-Reply-To
<20200804023253.GA1834@obg.localdomain> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
> Thanks for reporting this -- your analysis is spot-on; it was indeed a
> websocket closing.
> 
> I was mid-typing a lengthy email about why it shouldn't happen (pings
> and pongs keep it open, etc) when I reproduced it myself.

The pings and pongs would keep it alive for users with consistent connections,
but what about users on WiFi that doesn't quite reach to their corner of the
house (or who's laptop has a finicky WiFi setup)? If the user is disconnected
WiFi long enough that the pong is not sent in time, the connection would be
closed, right?

> so I updated it to 2.5 hrs, so that connections shouldn't drop mid game. So
> far, I haven't seen any issues.

Hmmm, that seems odd to me that their would have to be a max time for a
connection.  What if the game takes 2.5 hours? Or, more likely, what if the
group plays multiple games in a row? (based on what you say below about all
websocket connections counting as new players, I assume that starting a new
game preserves all the websocket connections)

> > To fix this, I believe you can add a callback whenever the websocket gets
> > closed; in the callback, you can just try to reconnect.  

The above two concerns are the reasons why I think this would still be
necessary even with the most correct configuration of the WebSocket server.

> I'll ponder this one -- currently we treat all incoming websocket connections
> as new players, so the UI would have to do some work with the backend to
> rejoin the player (while keeping the ui the same).

Ahh, I see.

> Out of curiousity, how did you find out about the project (if you don't mind
> me asking)?

I was browsing the projects list on sourcehut.org (I am working
https://sr.ht/~philipwhite/webpad/) and saw euchre-live; I know a lot of people
in Ohio, so I've played euchre a bit before. I've looked for self-hostable
card-game software before, so I was interested because it is something I wanted
to use, and I also knew people that I could use it with.

> 
> Thanks again, Alex

Thank YOU,
Philip
Details
Message ID
<20200805033201.GA5921@obg.localdomain>
In-Reply-To
<20200804090850.5b303da0@mordor> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
> The pings and pongs would keep it alive for users with consistent connections,
> but what about users on WiFi that doesn't quite reach to their corner of the
> house (or who's laptop has a finicky WiFi setup)? If the user is disconnected
> WiFi long enough that the pong is not sent in time, the connection would be
> closed, right?

Correct -- I think it would be feasible to add smarts to both the client
and server to rejoin, but in (very limited) practice, we haven't seen
connections drop.  The server doesn't consider connections closed for 30
seconds, and the client pings every 5, so there's some built in
redundancy there.

A smarter client/server that rejoined automatically is pretty high on
the list of things we'd need to make this more production-grade (that
and an undo button!). But at the moment, development is pretty slow (as
is our usage, clearly -- we haven't played in weeks, hence not
discovering this timeout bug).

> > so I updated it to 2.5 hrs, so that connections shouldn't drop mid game. So
> > far, I haven't seen any issues.
> 
> Hmmm, that seems odd to me that their would have to be a max time for a
> connection.  What if the game takes 2.5 hours? Or, more likely, what if the
> group plays multiple games in a row? (based on what you say below about all
> websocket connections counting as new players, I assume that starting a new
> game preserves all the websocket connections)

I totally agree; this is a restriction purely imposed by the deployment
setup (the reverse proxy). Nothing in the actual client/server
implementaion is setting a max-time (which is good). I chose 2.5hrs as a
stop-gap until I can take the time to research what a better solution
would be. relayd allows up to 68 year sessions haha, but I just picked
2.5hrs out of a hat (seemed safer to stay closer to the default, which
was probably picked for a reason).

I appreciate your concern, though! I'll bump it to 5hrs short term
because I anticipate it being days before I can look into changing the
setup in a major way.

> > Out of curiousity, how did you find out about the project (if you don't mind
> > me asking)?
> 
> I was browsing the projects list on sourcehut.org (I am working
> https://sr.ht/~philipwhite/webpad/) and saw euchre-live; I know a lot of people
> in Ohio, so I've played euchre a bit before. I've looked for self-hostable
> card-game software before, so I was interested because it is something I wanted
> to use, and I also knew people that I could use it with.

Oh nice! I figured that was the case. I haven't publicized the site at
all, so the sourcehut projects board is about the only link to it.

Happy to see a fellow euchre-playing sourcehut user :)

Cheers,
Alex
Reply to thread Export thread (mbox)