Closed FrederikP closed 4 years ago
Yea the reply part is really hacky right now. Can you use riot to show the source (click on the three dots and select "view source") and copy that into here? I guess some parsing error happens and I would need to see the riot source to be able to fix that. (Obviously anonymized is enough, so just replace user names by User1/User2)
{
"type": "m.room.message",
"sender": "@frederik:matrix.myserver.example",
"content": {
"msgtype": "m.text",
"body": "> <@frederik:matrix.myserver.example> ich bin begeistert\n\nklappt es auch vong matrix her?",
"format": "org.matrix.custom.html",
"formatted_body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!LOliBLduMoJwMyhHFj:matrix.myserver.example/$S<redacted>?via=matrix.myserver.example\">In reply to</a> <a href=\"https://matrix.to/#/@frederik:matrix.myserver.example\">@frederik:matrix.myserver.example</a><br>ich bin begeistert </blockquote></mx-reply>klappt es auch vong matrix her?",
"m.relates_to": {
"m.in_reply_to": {
"event_id": "$S<redacted>"
}
}
},
"origin_server_ts": <redacted>,
"unsigned": {
"age": 138,
"transaction_id": "m<redacted>.0"
},
"event_id": "<redacted>",
"room_id": "!<redacted>:matrix.myserver.example"
}
So I pushed a change where I made the reply handling a bit less hacky. Can you try that and see if that already helps? You just have to replace the matrix-puppet-signal/index.js with this file: https://raw.githubusercontent.com/witchent/matrix-puppet-signal/master/index.js
Okay I pushed another change (I think I found the reason for it thinking it was the other person who wrote the message). Please update the index.js as described above and try all sort of quotes again (i.e. quote yourself after sending it from the bridge/from matrix etc) and report your findings.
I tested it. When replying to my own messages it works fine now. That's good.
In most cases it doesn't work correctly when quoting other users messages. It reliably uses the same user for the same message though. For different messages of the same user, it doesn't use the same user.
original
me: hello
reply
> me: hello
me: this is a reply
This works fine
original
user1: hello
user1: how are you?
reply1
> user2: hello
me: this is a reply
reply2
> user2: hello
me: this is a second reply
reply3
> user3: how are you?
me: this is a reply to the other message
This is broken.
There is a chance that it uses the correct user, but I guess the chance is somewhere around 1/number_of_users
Were all messages sent after the latest update (including the messages you are trying to quote)? This changed something with how events are being saved, so it would be important to know if it is. As I am not part of a group with more than 2 users I cannot reliable test that stuff. I will try to get some people to make a testgroup and test it there, sorry for that.
Edit: What would also be important to know is from where you sent the messages, i.e. from matrix or signal and if they behave the same or not. And if the wrong people are quoted in matrix or signal.
Yes. Tested with fresh messages. My friends are happy test subjects who are kinda weirded out by having their name on messages they didn't write :D
The replies are always sent from matrix. The original messages (from friends) are written on signal, except mine. I guess that could be the reason it works for me.
Edit: Even if I send messages from signal and reply to them in matrix it works fine. So that doesn't seem to be the "full" reason.
Okay if you have some test subjects, can you do me one big favor?: Can you download: https://raw.githubusercontent.com/witchent/matrix-puppet-signal/c63ec88cc60941c868de61db1f05f92588773311/index.js and try with that one (so replace index.js again) the following: Let your other users send new messages in the group. Then quote them from matrix and tell me if that works.
This would just rule out if its a regression happened because I changed the logic of the eventstore. It is important that all messages are sent after you reverted the file though.
Did that. Now even the first scenario doesn't work again (regression) as originally reported. I guess that was expected. Replying to my own message makes the quote be assigned to a different user in signal.
The other scenario (replying to messages written by others) also doesn't work. Looks like it's the same behavior in that case as with latest master.
Okay awesome, thanks. Yes, not being able to correctly quoting your own message was expected, but it is good to know that I did not screw something else up. Now on to convince some people to try out group with me :D
I think I know the cause, but I need some time to redo the logic and test it first, so its gonna take a few hours. Will write as soon as I have something that I think should work.
Can you test it with the newest version? You need to let everyone send new messages before quoting them again.
wow that was quick. It works. Didn't find any other weirdness with replies. Thanks!
Awesome, thank you for your help and patience fixing those bugs
I just tried using the reply feature of matrix in a signal group chat, mainly just to see if it works.
Indeed, a reply message containing the correct text was created in signal, but showing the wrong original sender.
This is in signal:
This is the same convo in riot/matrix:
In signal the quote looks like it's coming from user2 (who is part of the group). But it does not, as you can see in the riot screenshot.
Also note the
</blockquote>
tag.