facebook icon indicating copy to clipboard operation
facebook copied to clipboard

Additional noisy FB room is created while chatting via Facebook with another bridge user.

Open Liarra opened this issue 2 years ago • 3 comments

The first time I've noticed this problem is Friday 25th. Here is how to reproduce.

Say there are two users on a Matrix server, Alice and Bob. Both of them also use Facebook accounts and make use of the facebook bridge.

  • To trigger the problem, Alice should use a Matrix client (say, Element) to write to "Bob (FB)", which is a representation of Bob's Facebook account.
  • Then, a room called "Alice (FB)" will appear for Alice. Alice's initial message will appear in this room triggering notification. Same happens to Bob if he messages "Alice (FB)" via Matrix bridge.

Upon closer inspection, it seems like both FB rooms contain 4 users:

  1. Alice (matrix)
  2. Bob (matrix)
  3. Facebook bridge bot;
  4. FB puppet of Alice or Bob, depending of whose FB account the room is supposed to represent.

Therefore, each time Alice writes to Bob (or Bob to Alice) this message gets delivered to the FB room. Since that FB room contains both Matrix users, the sender will be notified with the message they've just sent.

Edit: Leaving your own (FB) room doesn't help, as with each new message the user will be re-added back.

Liarra avatar Mar 27 '22 14:03 Liarra

Well for one, why would you want to talk through FB with peoples having matrix? But also adjacently, if you do doublepuppeting (login-matrix) shouldn't this behavior stop too? (as you're now puppeting both ways)

olmari avatar Mar 28 '22 00:03 olmari

The important note is that I have installed the bridge using this ansible script: https://github.com/spantaleev/matrix-docker-ansible-deploy According to the docs, that should result in automatic double puppetting: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-bridge-mautrix-facebook.md#set-up-double-puppeting

I tried enabling double puppeting with login-matrix anyway. the behaviour stays the same.

Liarra avatar Mar 28 '22 10:03 Liarra

To add some detail to this since my users are seeing this:

The problem is specifically with direct Facebook chats. If I (facebook ID AAAAA) message another Matrix user (facebook ID BBBBB) that has the Facebook bridge setup, the bridge sets up two chats, [AAAAA <-> BBBBB] and [BBBBB <-> AAAAA].

In Matrix, I get joined into both rooms. The two rooms are:

  • [AAAAA <-> BBBBB]: this "looks" like the correct chat. It is named "Person B (FB)" and has Person B's facebook picture as the room picture. There are four participants: the FB bridge bot, my Matrix user, Person B's facebook puppet, and Person B's Matrix user. As expected, my puppet is not a participant.
  • [BBBBB <-> AAAAA]: this is the "incorrect chat". It is named with my name "Person A (FB)" and has my Facebook picture. There are four participants, the FB bridge bot, Person B's Matrix user, my facebook puppet, and my Matrix user.

Double puppeting is correctly setup and works for both users.

I believe the problem is the bolded users, that shouldn't be invited. Comparing to how this is managed on other bridges like mautrix-signal, only your puppet is joined into the equivalent [BBBBB <-> AAAAA] room, which means that you only see the room corresponding to your side of the DM.

@tulir I'm happy to make a PR if you point me in the right direction. I think it's basically coming from some joining script marking both chats as joinable by the real Matrix user, but after some digging I didn't find what I was looking for.

meson800 avatar Nov 11 '22 23:11 meson800