mattchrlw/yeetbeat

Technical Debt

Opened this issue · 0 comments

Just going to type this out and leave this here, in case we keep working on this. These are things which need to be fixed:

  • Client is spaghetti. Because of cloak, the client just blindly changes views whenever the server tells it to.
  • Client lacks validation. Switches views immediately when button clicked, without ensuring room exists/username valid, etc. This is indirectly caused by cloak.
    • Also uses Javascript in HTML onclick to switch views. Some are overriden in scripts.
  • Server is a mess. The video URL downloading is unreliable. Should switch to official APIs to have clients play the videos locally.
  • Because of cloak, pings to the server which should have responses are implemented with a "*Response" cloak message event. This is bad because the client doesn't block for them and it offers no chance for the server to reject the request. See (2).
  • On that topic, the pre-game authentication logic should be done using normal HTTP(s) endpoints in express.
  • Implementing Spotify streaming would be nice. Would require abstracting away the video player into a general audio player from a URL.
  • Waiting for players to load the song is very dodgy, especially if players disconnect or have poor internet connection. Cloak was meant to handle disconnects.
  • Scoring should be done on server-side using timers.
  • HTML is a bit inconsistent but largely functional.
  • Can we find something like cloak but it works?

Finally,

  • Rewrite in Typescript / React / mobX with an actual interface between client and server. In particular, client state could be inconsistent when changing between views.