-
-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Messages limited to 2000 bytes, where is this limit defined? #1598
Comments
Not sure how come I've missed it... Isn't it these line?
Can we raise it to meet the new 65536 bytes limit please @AsamK ? |
I understand this piece of code is supposed to create a special attachment with mime LONG_TEXT ("text/x-signal-plain"). But strangely that doesn't seem to work (my clients don't appear to receive it or process it). All I receive is the trimmed message. signal-cli/lib/src/main/java/org/asamk/signal/manager/internal/ManagerImpl.java Lines 757 to 761 in 304c440
|
I'd rather have a higher limit too. 2000 chars is not that much and it's hard to tell if the message will get truncated because the use of UTF-whats-so-ever. Attachments are inconvenient in Signal Desktop as they must be downloaded first and then opened in a second step. A high message limit would mitigate those issues. |
I managed to find a workaround by manually creating the "text/x-signal-plain" attachment and I can confirm it is working as expected (clients process it as text, even can apply style to it). The message can be empty as it will be replaced by the attachment text. This is exactly what the code here should be doing, so not sure why it does not work... signal-cli/lib/src/main/java/org/asamk/signal/manager/internal/ManagerImpl.java Lines 757 to 761 in 304c440
Here is a PoC with test.txt containing a large text:
|
Signal-Android has the same logic to split messages larger than 2000 UTF-16 chars: MAX_PRIMARY_SIZE There was a bug in the signal-cli implementation, that the text attachment was only sent when there were other attachments as well. |
It would appear that historically messages were limited to 2000 bytes. This is no longer the case as clients now accept up to 65536 bytes: For ref. signalapp/Signal-Android@ccfcfa7 & signalapp/Signal-Android#5146
signal-cli-native appears to enforce this limit somehow, but I'm not able to find where that limit is defined. I also looked into https://github.com/signalapp/libsignal. Messages that are over 2,000 bytes get timed right at this limit.
Any idea?
I can confirm that my clients can receive more than 2000 bytes of message when the message is sent using signald which uses https://github.com/Turasa/libsignal-service-java but also when using official native clients for iOS/Android.
There was mention of this issue here as well: #6, but it's unclear how to turn messages into a text attachment. Is there a special kind of attachment to use that the clients would then render as if it was a message?
The text was updated successfully, but these errors were encountered: