SneedChat Complaint Thread

  • 🏰 The Fediverse is up. If you know, you know.
  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
I've always found it weird and annoying that I don't have any control over the nonstop torrent of shitposts that flood in if you make the mistake of leaving the forum open on the front page, or any page with the chat enabled. It's the most un-forum-like feature on the site and I never really read it anyway. Either an option in settings or simply an initial click being required to load the chat would go a long way for this.
 
Is there an issue with chat right now? I don't seem to be able to join anything and the site was throwing up a generic database error message up for a couple minutes.
 
There is a weird issue I have in only sneed chat (at least it's only there now) where some reactions, and people's pfp have the colors inverted or something so they are impossible to actually see. I can get a screenshot tonight to show an example. But it seems to consistently happen. I thought it was dark reader at first. But completely disabling it did nothing.
 
I'm making chat active on any relevant page again. If you have a suggestion to improve chat's performance let me know.

Edit: If you just really, really hate chat and there's nothing I can do to compel you to try it or help me improve it there's now an option to disable it.

@Spooky Dogwood
1759357858947.png

Chat has been a part of this website since 2014. It was disabled during DKF because of performance issues.

Users being in chat is good for the health of the site.

If you can stop being a fag that'd be awesome.
 
Last edited:
@Spooky Dogwood
View attachment 7986756

Chat has been a part of this website since 2014. It was disabled during DKF because of performance issues.

Users being in chat is good for the health of the site.

If you can stop being a fag that'd be awesome.
If you're concerned about user-retention, then I imagine a lot of people would find it obnoxious if there's no on-site method to turn off the chat. I thank you for remedying that issue.
 
we had the chat on the site for 10+ fucking years without a fucking problem mate, thanks for your concern!
 
we had the chat on the site for 10+ fucking years without a fucking problem mate, thanks for your concern!
While you're here, I (and many others) would appreciate a fix to this:
Message edits get double escaped. This causes HTML characters in edits to show up as their escaped equivalents (e.g. < ).
This is still a significant problem, so I looked into it with the limited information I have available.

The issue appears to be that messageEdit uses .innerHTML to get the edit input field's content, which outputs escaped HTML. Messages send from the normal input field are processed using .textContent to get the input's content, so this is why there are no escaping issues in normal messages.

JavaScript:
var messageEdit = function messageEdit(messageEl) {
    messageEditReverse();
    messageEl.classList.add("chat-message--editing");
    var contentEl = messageEl.querySelector(".message");
    messageEl.originalMessage = contentEl.outerHTML;
    var formEl = document.getElementById("new-message-form").cloneNode(true);
    formEl.id = "edit-message-form";
    var inputEl = formEl.querySelector(".chat-input");
    inputEl.id = "edit-message-input";
    var submitEl = formEl.querySelector("button.submit");
    //submitEl.id = "edit-message-input";
    submitEl.remove();
    contentEl.replaceWith(formEl);
    inputEl.innerHTML = messageEl.rawMessage;
    inputAddEventListeners(inputEl);
    inputEl.addEventListener("keydown", function(event) {
        switch(event.key){
            case "Escape":
                event.preventDefault();
                messageEditReverse();
                return false;
            case "Enter":
                event.preventDefault();
                messageSend("/edit " + JSON.stringify({
                    id: parseInt(messageEl.dataset.id, 10),
                    message: this.innerHTML
                }));
                messageEditReverse();
                return false;
        }
    });
    // Apparently, .focus() doesn't work on contenteditable=true until one frame after.
    inputFocusEnd(inputEl);
};
JavaScript:
document.getElementById("new-message-input").addEventListener("keydown", function(event) {
    switch(event.key){
        case "Enter":
            event.preventDefault();
            messageSend(this.textContent);
            this.innerHTML = "";
            return false;
        case "ArrowUp":
            if (!this.innerHTML) {
                event.preventDefault();
                var messageEls = document.getElementById("chat-messages").querySelectorAll(".chat-message[data-author='".concat(APP.user.id, "']"));
                if (messageEls.length > 0) {
                    var messageEl = messageEls[messageEls.length - 1];
                    messageEdit(messageEl);
                }
                return false;
            }
    }
});

Using .textContent or unescaping the .innerHTML result would most likely fix this.
 
I've always found it weird and annoying that I don't have any control over the nonstop torrent of shitposts that flood in if you make the mistake of leaving the forum open on the front page, or any page with the chat enabled. It's the most un-forum-like feature on the site and I never really read it anyway. Either an option in settings or simply an initial click being required to load the chat would go a long way for this.
Or how about stop bitching? Ever consider that?
 
I have updated the chat js for the first time in 3 years to try and resolve the memory leak issue. The code now attempts to manually unload images and events.
 
I've always found it weird and annoying that I don't have any control over the nonstop torrent of shitposts that flood in if you make the mistake of leaving the forum open on the front page, or any page with the chat enabled. It's the most un-forum-like feature on the site and I never really read it anyway. Either an option in settings or simply an initial click being required to load the chat would go a long way for this.
Just get banned from it and it'll stop appearing.
 
itstoobrightcbf2fix.jpg
if you enlarge my very bright thumbnail, you will see, on the right side, 3 faint lines. this is not a screenshot glitch, this is what i see in chat. yes, i am using brave.

it wouldn't even be an issue if the lines didn't flicker for some fucking reason. edit: flickering seems to happen on better monitor with higher resolution, idefk man

edit 2: adding thumbnail to demonstrate issue on my other mid-range monitor with lower resolution. the 'flickering' of the lines isn't as noticeable
atleastitsnotbright.jpg
 
Last edited:
I have updated the chat js for the first time in 3 years to try and resolve the memory leak issue. The code now attempts to manually unload images and events.
Any chance I can get you to make this one line change?
This is still a significant problem, so I looked into it with the limited information I have available.

The issue appears to be that messageEdit uses .innerHTML to get the edit input field's content, which outputs escaped HTML. Messages send from the normal input field are processed using .textContent to get the input's content, so this is why there are no escaping issues in normal messages.
I and many others in chat would appreciate it greatly.
 
Are comic sans users who are confined to spergatory supposed to be able to use chat? Just curious, I've seen a few pop in, recently freeross was in there but I heard he got banned from chat afterwards anyway.
 
Noticed this in BP chat:
1766527741963.png
I assume it has something to do with unicode bullshit relating to arabic being written right-to-left.
 
If you have a suggestion to improve chat's performance let me know.
I noticed the chat opens a totally new connection for every single tab. If I've got 5 tabs open, that's 5 separate sockets and 5 handshakes spamming the server. You might want to look into moving the socket to a SharedWorker. It lets the browser share just one connection across all open tabs, which should cut down the CPU load from handshakes significantly.

The only annoying thing is Chrome on Android doesn't support it yet, so you'd need a simple check to fall back to the current method for mobile users.
 
Back
Top Bottom