y’know with the whole random sports redirects

  • flubba86@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Websockets are a web technology that provide a new way for a website or webapp (running in your browser) to communicate with a server. In this case, it is one of the ways the Lemmy webapp can communicate with the Lemmy server.

    There have been a few different web technologies used over the years to achieve this, with websockets being relatively new. One advantage websockets have over other solutions is it allows bidirectional communication between the website and the server, and it can hold the connection to the server open for long periods of time to watch for new data coming in. This allows a developer to build powerful and dynamic applications.

    It seems like Lemmy v0.17 server-side code has a fundamental issue with how it handles open websockets connections. It was a known issue, was low priority, but suddenly became a big issue when Lemmy rapidly grew with Reddit refugees. Rather than track down the root cause, it was determined to be easier to simply remove the websockets feature in v0.18.

    The issue can manifest itself eg when you are browsing by “All”, the website holds open persistent connection to the server to receive all new post submissions so it can show you them without you needing to refresh the page. However the websocket connection will also get flooded with extra posts whenever the Lemmy server syncs with a community from another instance. That is why you might occasionally get suddenly flooded with dozens of new posts from a cooking community from a different instance, including posts from days ago.

    The sports results issue is different. It only happens when you click on a post to open it. I haven’t looked at the code, but I’m not convinced it’s a websockets issue. From what I have read, the consensus is “it’s probably a websockets issue, and it should be fixed with the removal of the use of websockets in v0.18”. There were hundreds of changes do the server code between v0.17 and v0.18, so it could be that one of the other changes fixed that bug.