LoCo Day 15

Another day where I didn’t set aside enough time to get much accomplished. I addressed the problem of a user inadvertently getting unsubscribed from a room’s messages upon reloading the page by always (re-)subscribing them whenever they try to fetch messages. At worst, they’ll miss out on messages sent while the reload was taking place, but that’s reasonable.

I then started adding hooks for actually running a game out of a room. I got mostly through the code for letting members of a room signal when they’re ready to play. Right now, since there’s no actual game implemented, there’ll be a game-started message immediately followed by a game-over message once everyone is ready.

At some point I should write test cases for all the code that implements room-related stuff, but since it’s almost entirely within the IO monad, that makes coming up with good QuickCheck properties a nontrivial exercise. Doable, certainly — I did it for the multicast channel code, since there’d be all kinds of problems if that didn’t work correctly — but not nearly as easy as coming up with properties for pure code.

Comments Off