Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

SMS cut off at 2000 characters

Open asvetlovsky opened this issue 10 years ago • 29 comments

When sending an unsecured SMS greater than 2000 characters, it appear cut-off in my sent view. The receiver confirmed that the entire text has gone through successfully.

It seems like Signal cuts off displaying SMS messages at about 2000 character, even though it's possible to send longer ones.

asvetlovsky avatar Jan 28 '16 15:01 asvetlovsky

Evidence suggests this is also true for Signal messages, not just SMS. :open_mouth:

liliakai avatar Jan 29 '16 19:01 liliakai

@liliakai true, I just tested this.

Sending push messages from android is possible with > 2000 characters. The message gets fully trasmitted and shown at Signal-Desktop. But just the first 2000 characters are displayed on android (sending & receiving side)

agrajaghh avatar Jan 29 '16 20:01 agrajaghh

What is the reason for this 2000 characters limit? Can't be DOS protection, since attachments are way bigger anyway, no?

I'm not sure how to proceed, but I would suggest to raise this limit to at least 20.000 for push messages, since we have desktop clients now as well, and it's an imaginable usecase to copy & paste longer texts I guess.

Since we can't control other SMS apps, I guess incoming SMS should always be displayed at full length, no?

agrajaghh avatar Jan 29 '16 20:01 agrajaghh

@agrajaghh wasn't there an issue regarding (decryption) speed for larger messages when scrolling through convos?!

McLoo avatar Jan 30 '16 08:01 McLoo

@McLoo that rings a bell, but I couldn't find it at the moment though :smirk: but I found #3658 and #3362 (duplicates) :grin:

agrajaghh avatar Jan 30 '16 10:01 agrajaghh

What's the verdict on this? 20k character limit for displaying sms? Or 20k characters for outbound messages, display full text for inbound SMS as @agrajaghh suggested? 20k limit for everything seems reasonable, I don't think SMS is protocol over which I want to be receiving >20k character messages.

lolstarz avatar Feb 04 '16 22:02 lolstarz

What is the reason for this 2000 characters limit?

From what I gather, there are some performance issues and crashes associated with rendering huge text views in Android.

liliakai avatar Feb 05 '16 01:02 liliakai

@liliakai , So you say it's android fault of rendering huge text and we can't solve it?

If it's true, I think this issue should be closed.

getsadzeg avatar Feb 06 '16 17:02 getsadzeg

Other SMS apps, like Hangouts, are able to render more than 2000 characters just fine.

On Sat, Feb 6, 2016, 12:38 Guri Getsadze [email protected] wrote:

@liliakai https://github.com/liliakai , So you say it's android fault of rendering huge text and we can't solve it?

If it's true, I think this issue should be closed.

— Reply to this email directly or view it on GitHub https://github.com/WhisperSystems/Signal-Android/issues/5146#issuecomment-180817597 .

asvetlovsky avatar Feb 06 '16 17:02 asvetlovsky

Okay, so it's not Android's fault.

One thing I(we) know is that in MessageRecorder class, there's variable MAX_DISPLAY_LENGTH with value of 2000 in it. It's referenced in code to cut off characters:

else if (getBody().getBody().length() > MAX_DISPLAY_LENGTH) {
      return new SpannableString(getBody().getBody().substring(0, MAX_DISPLAY_LENGTH));
    }

I'm strongly interested in reason of displaying max characters number as 2000.

getsadzeg avatar Feb 06 '16 17:02 getsadzeg

I'm not saying that it's impossible to display long text on Android. I'm saying that with Signal-Android's current front end architecture, naively removing the limit may cause some phones to crash sometimes.

liliakai avatar Feb 06 '16 21:02 liliakai

current front end architecture is really common,I think.

getsadzeg avatar Feb 06 '16 21:02 getsadzeg

If someone is interested in looking into this #3148 has more info on rendering large messages.

2-4601 avatar Feb 09 '16 01:02 2-4601

The fix could be as simple as preventing the user from sending more characters than 2k. At least they'd know the message wouldn't go through correctly (this should be done on Signal-browser too)

ghost avatar Feb 17 '16 17:02 ghost

Is there any update? Messages are still getting cut off when either sending or receiving 2000+ characters.

asvetlovsky avatar Mar 25 '16 19:03 asvetlovsky

The problem/feature still persists and I would love to at least understand why this cutoff exists, even if nothing can be done about it. I regularly send huge chunks of text I've typed on Simplenote over WhatsApp but sending them over Signal requires breaking them into a series of shorter messages and this really affect both ends of the experience. Just knowing would provide closure.

lokesh-krishna avatar Oct 23 '16 05:10 lokesh-krishna

Possible fix suggested in #4230.

FeuRenard avatar Oct 24 '16 08:10 FeuRenard

Thanks for pointing me there. How is it a fix though? It is a request, right?

lokesh-krishna avatar Oct 24 '16 08:10 lokesh-krishna

I just wanted to link this issue here.

Addressing your question:

  • The limit is set here.
  • Hitting "Blame" in the top right of the above mentioned page shows you, that the limit was introduced by https://github.com/WhisperSystems/Signal-Android/commit/724dced8209646df4cb2e0e0543a7dbd2b8bc2b1
  • This commit closes #2294 which possibly offers you some information you want

FeuRenard avatar Oct 24 '16 09:10 FeuRenard

I don't get why they set a limit. Can anyone explain the gist of PR @FeuRenard commented? Did Signal crash because of no limit of messages or something?

getsadzeg avatar Oct 24 '16 12:10 getsadzeg