Skip to content
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

Long messages which respond to another message get split incorrectly #1059

Open
tgr opened this issue May 31, 2020 · 4 comments
Open

Long messages which respond to another message get split incorrectly #1059

tgr opened this issue May 31, 2020 · 4 comments
Assignees
Labels
T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems.

Comments

@tgr
Copy link

tgr commented May 31, 2020

When writing a message that's longer than the IRC limit, while responding to another message, the bridge will prefix some words from the replied-to message (ie. it turns the response relationship into a quote) and splits the message into shorter chunks that do not get truncated on IRC. It seems the chunk calculation ignores that the quotation made the message longer, though, so you end up with some truncation happening in the middle:
matrix long response message
irc long response message
(link to original comment)

@Half-Shot Half-Shot added the bug label Jun 3, 2020
@Half-Shot
Copy link
Contributor

Hey @tgr, thanks for reporting. I'm finding it difficult to reproduce this bug, could you send me an example message and reply text so I can reproduce it locally?

@tgr
Copy link
Author

tgr commented Jun 21, 2020

Sorry for the slow response! Reproduction steps:

  • Visit #wikipedia-hu:matrix.org (which is manually bridged to #wikipedia-hu@Freenode) in Riot-web and an IRC client (I've been using irssi).
  • In Riot-web, click "Reply" next to this message.
  • Type in grin: alapvetően itt az a nehézség, hogy az IRC szar, a Matrix meg nem az. Ha egy másik olyan rendszerrel kéne illeszteni, ami tud rich text tartalmat kezelni, szoba történetét valamilyen strukturált módon megjeleníteni, lehet hozzászólásokat szerkeszteni, vannak benne normális identitások, rendes topic API stb. stb. akkor normálisabban működne. De vízözön előtti technológia (régebbi, mint a web), úgyhogy ez van. Ezért is lenne fontos, hogy a Wikimédia mozgalom átálljon valamire, amitől egy mai felhasználó nem szalad el sikítva. Én reménykedem, hogy a magyar wiki és chapter ebben úttörő szerepet tud játszani. as the reply, and send. (The name at the beginning is via tab-completion for grin@grin.hu.)
  • View the message in the IRC client.

This time, it failed in a somewhat different way:
matrix-irc-bug-2
(Also all the non-ASCII characters are broken, which I assume is an artifact of the message being truncated in the middle of an UTF-8 byte sequence.)

I tried to reproduce with a fresh message too, but that worked fine. So my original assumption that this was caused just by the combination of quoting + long message seems to be incorrect. Which also means I don't have an idea what the local reproduction steps would be :(

@Half-Shot Half-Shot self-assigned this Jun 21, 2020
@Half-Shot
Copy link
Contributor

Thanks @tgr, and yes it might be that we aren't splitting sensible for non-ASCII, I remember there are quirks in JS around multi-byte characters. I can at least take a look at that one, but I think it may be difficult to reproduce your original bug, so will see what I can achieve.

@Half-Shot
Copy link
Contributor

This may actually be #706

@justinbot justinbot added T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems. and removed bug labels May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems.
Projects
None yet
Development

No branches or pull requests

3 participants