this post was submitted on 25 Jun 2023
23 points (89.7% liked)

No Stupid Questions

36307 readers
2151 users here now

No such thing. Ask away!

!nostupidquestions is a community dedicated to being helpful and answering each others' questions on various topics.

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules (interactive)


Rule 1- All posts must be legitimate questions. All post titles must include a question.

All posts must be legitimate questions, and all post titles must include a question. Questions that are joke or trolling questions, memes, song lyrics as title, etc. are not allowed here. See Rule 6 for all exceptions.



Rule 2- Your question subject cannot be illegal or NSFW material.

Your question subject cannot be illegal or NSFW material. You will be warned first, banned second.



Rule 3- Do not seek mental, medical and professional help here.

Do not seek mental, medical and professional help here. Breaking this rule will not get you or your post removed, but it will put you at risk, and possibly in danger.



Rule 4- No self promotion or upvote-farming of any kind.

That's it.



Rule 5- No baiting or sealioning or promoting an agenda.

Questions which, instead of being of an innocuous nature, are specifically intended (based on reports and in the opinion of our crack moderation team) to bait users into ideological wars on charged political topics will be removed and the authors warned - or banned - depending on severity.



Rule 6- Regarding META posts and joke questions.

Provided it is about the community itself, you may post non-question posts using the [META] tag on your post title.

On fridays, you are allowed to post meme and troll questions, on the condition that it's in text format only, and conforms with our other rules. These posts MUST include the [NSQ Friday] tag in their title.

If you post a serious question on friday and are looking only for legitimate answers, then please include the [Serious] tag on your post. Irrelevant replies will then be removed by moderators.



Rule 7- You can't intentionally annoy, mock, or harass other members.

If you intentionally annoy, mock, harass, or discriminate against any individual member, you will be removed.

Likewise, if you are a member, sympathiser or a resemblant of a movement that is known to largely hate, mock, discriminate against, and/or want to take lives of a group of people, and you were provably vocal about your hate, then you will be banned on sight.



Rule 8- All comments should try to stay relevant to their parent content.



Rule 9- Reposts from other platforms are not allowed.

Let everyone have their own content.



Rule 10- Majority of bots aren't allowed to participate here.



Credits

Our breathtaking icon was bestowed upon us by @Cevilia!

The greatest banner of all time: by @TheOneWithTheHair!

founded 2 years ago
MODERATORS
 

y'know with the whole random sports redirects

top 3 comments
sorted by: hot top controversial new old
[–] flubba86 7 points 2 years ago* (last edited 2 years 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.

[–] [email protected] 3 points 2 years ago

They’re an “always open” connection between your client and the setver. HTTP works by the client sending a request with a return address and the server sending a reply to that address. Wbsockets then create a “socket” connection to the client that can send data at any time without having to open a new connection, negotiate the protocol, and send all the return address/header information/ etc.

Since the socket is already open, no new context is needed and small bits of data can be sent back and forth quickly.

[–] [email protected] 3 points 2 years ago

A socket is a dedicated tube for communications back and forth between server and client (the website) all within a single connection. A socket is nice because it's an easy interface for sending arbitrary data either direction without the client needing to know to explicitly request information from the server. That makes it easier to have a application which responds to changes rapidly. The way Http worked traditionally didn't allow for servers to push data because Http has a single request and response per connection and clients usually have no ports open (required to receive connections), meaning clients need to request data.

Websockets are a technology built on top of later versions of http and allow a "fake" socket interface which allows servers to push data without the client explicitly requesting it as long as the webpage is open. In this case the server was either sending back the wrong information to the wrong users or the client got mixed up about what to do with the data the server was sending. Either way the bugs lemmy was seeing isn't intrinsic to Websockets and was purely an implementation issue. The downside for Websockets is it can be a lot of information and heavy overhead to support if not implemented carefully, in lemmy's case the developers decided to give up on it rather than spend time trying to fix it due to the sudden increase in users and demand on servers. It could potentially return in the future, hopefully in a more polished state.