Message Too Long Chat Error

message_too_long

Today I encountered this issue for the first time. I had taken the time to write a rather extensive message to my opponent. In the past the message has been cut up into many smaller messages for me. But today, I received this error and there was no way to get my message back.

Suggestions

  • If this outcome is programmed on purpose, I would like to suggest that the Chat box not be cleared. That the user be informed the message will be too long to submit, so they can edit it accordingly.

  • It would also be helpful to note how many characters the message attempting to be submitted is and what the maximum character limit is.

12 Likes

Haven’t seen this before… @anoek any ideas what happened here?
Gonna also pink @flovo , @RubyMineshaft , and @GreenAsJade as I think they’ve poked around in the chat code before? Might have stumbled upon this?

1 Like

My guess is the message contained a dragon (I’ll see myself out)

2 Likes

I would expect the chat box to stop accepting input when it reached the limit. So you’d know to send it and continue if necessary (or edit as you say)

4 Likes

FWIW:

   function chat_markup(...)

    if (!lengthLimit) {
        lengthLimit = 1024;
    }
    if (body.length > lengthLimit) {
        return [<span key="message-too-long">&lt;{_("Message too long")}&gt;</span>];
    }

… yes, it is limiting you to 1024 chars.

I agree that dumping them isn’t great. I think it’s worth raising a bug on that: you should be blocked from typing more than the max.


Note to devvers: it’s not clear to me why a routine responsible for chat markup is imposing a character limit.

This should really be done in the input control, eh?

8 Likes

It was discussed briefly in anoek’s review on this PR because I tried to take it out: Mod note improvements by RubyMineshaft · Pull Request #1371 · online-go/online-go.com · GitHub

The good news is the message isn’t lost, it’s just not showing since some super long messages were crashing browsers. The limit could probably be increased a bit or we should at least add some sort of input validation.

5 Likes

Yeah - input validation seems to be in order, although interstingly we can’t always control that: phone apps for example can presumably submit non-compliant chat, unless the API also blocks it?

1 Like

I suppose we’d just have the validation match whatever display limit we have set. It would stop messages that are too long from being submitted on the webapp (or split them up before sending), but third party apps would need to set up their own checks or we’d still show the <Message too long>.

A combination of increasing the limit and implementing a validation would probably take care of the issue for the vast majority of messages though, I’d imagine.

3 Likes

Yeah, I had this before too in a teaching game. It was pretty annoying. Maybe there could be a little indication of characters remaining, like 12 / 1024 to indicate you have 12 characters left till you hit the limit?

4 Likes

Shouldn’t it be enough to split the message on the receiving side? Either in char_markup or before.

I think it’s tough to split markup without breaking it - either the input or the output.

Yes that’d be the standard kind of input validation etc that we should so.

2 Likes

But this is how it used to be apparently

I wonder if the markup has always been there, or whether it’s the addition of this that brings the difficulty of splitting?

I certainly find it hard to picture just how you would readily split markup… but maybe that’s me being dense (happens all the time, no surprise there).

I think at the moment as well if a message is too long, it just gets cut off rather than being split into multiple messages.

At least I feel like that’s happened regularly enough. I hadn’t seen the <message too long> message before.

Note: markup is not supported in PM chat

So you won’t get this message in PMs, but you will get it in game chat, where markup is supported…

In PM chat you can send at least 1025 characters.

(I know this now because I just tried it)

(And this goes to show why chat_markup is not the right place to implement message-size limitations)

1 Like

The reason that exists is because we had several instances where folks would copy/paste huge blocks of text in an attempt to lag out their opponent, which sometimes worked. We don’t split anymore because it doesn’t fix that. I’m OK with raising the limit from 1024 though, I’m not sure what would be a good value though, nothing too high.

8 Likes

How about posting the first 1024 characters, followed by " (…)" and a message below stating that the previous message was cut short for being too long?

2 Likes

I mean it makes sense except you do have to remember what the rest of your message said since it’s now gone into the void.

I think visually showing people they’re about to run out of characters is necessary with these restrictions. It might not avoid frustration, but at least it explains itself.

8 Likes

I think if there is a hard limit on displaying over 1024 char there should also be a hard limit on typing over 1024 char.

4 Likes

I think it’s fine to have a 1024 limit. I think (as we’ve all been observing) the right thing is validation as you type. People are accustomed to this mechanism.

… it avoids this, because it you are typing manually, you get stoped immediately, and if you are pasting you still have your clipboard.

1 Like