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

No contacts/chats appearing in matrix messenger #607

Open
patrickjane opened this issue Apr 7, 2023 · 4 comments
Open

No contacts/chats appearing in matrix messenger #607

patrickjane opened this issue Apr 7, 2023 · 4 comments

Comments

@patrickjane
Copy link

patrickjane commented Apr 7, 2023

I have just setup a synapse server & the matrix bridge using docker. Both services run fine, and the bridge can connect to synapse. The homeserver is also reachable via the internet. I can successfully connect to the homeserver from all my devices (mobile, PC, laptop) using several matrix clients.

I logged in to whatsapp using the whatsappbot's login command. This seemed to be successful, according to the bridge's log:

2023-04-07T14:18:54Z INF Successfully paired XXXXXXXXXXXX.0:5@s.whatsapp.net module=User/@username:homeserverurl/Client
2023-04-07T14:18:54Z INF Got 515 code, reconnecting... module=User/@username:homeserverurl/Client
2023-04-07T14:18:55Z INF Successfully authenticated module=User/@username:homeserverurl/Client
2023-04-07T14:18:55Z INF Uploading 50 new prekeys to server module=User/@username:homeserverurl/Client
2023-04-07T14:18:57Z INF Stored 11 privacy tokens from history sync module=User/@username:homeserverurl/Client
2023-04-07T14:18:57Z INF Resyncing displaynames with 65 contacts module=User/@username:homeserverurl.com
2023-04-07T14:19:00Z INF Updating contact store with 329 push names from history sync module=User/@username:homeserverurl/Client

However, in none of the matrix clients, any whatsapp conversation or group is appearing. I can e.g. query contacts successfully using the list contacts command of the whatsappbot, so the connection to whatsapp seems to work.

What is wrong here? Since I failed to find a comprehensive guide for the configuration file, and the configuration consists of tons of parameters where I severely lack understanding for, I more or less took the example config, plus the mandatory adjustments.

What should I do?

@patrickjane
Copy link
Author

patrickjane commented Apr 8, 2023

Okay now 2 chats appeared for new messages I received. They show up as direct message invite which I need to accept.

So the issue seems to be that existing chats from WhatsApp are not synced. Why?

In addition, messages I am sending on the official WhatsApp app do not appear on the now available 2 direct messages in matrix. Is this this feature not supported in general, or should messages sent by myself also be bridged?

I had a paid element.io account for testing a while back, and it perfectly synced everything, including old messages. Contact names also were okay. Since I think its using the very same technology, I guess this must be configuration issues on my side?

@maltee1
Copy link

maltee1 commented Apr 8, 2023

You need double pupetting to have messages sent from the official client appear in matrix. Double puppeting will also auto-accept invites for new conversations.

You need to set up the bridge to auto-create both group chat and contact portals (not sure about the exact setting, but they're called something descriptive). WhatsApp sends a blob of data that allows this, but only once upon login, so just enabling won't work - you have to log out and log in again.

@patrickjane
Copy link
Author

patrickjane commented Apr 8, 2023

I only see create_portals as option which might correspond to what you said, and its set to true in my config. The only other options which relate to "group" are:

   # Should Matrix users leaving groups be bridged to WhatsApp?
    bridge_matrix_leave: true

    # Should group members be synced in parallel? This makes member sync faster
    parallel_member_sync: true

    # Allow invite permission for user. User can invite any bots to room with whatsapp
    # users (private chat and groups)
    allow_user_invite: false

        # Allow encryption, work in group chat rooms with e2ee enabled
        allow: false

Don't think they correspond to the option you were talking about?

[edit] I just set this in homeserver.yaml:

experimental_features:
  msc2716_enabled: true

And then backfill: true and request_full_sync: true. Now the conversations are coming in, one by one, slowly.

So this is the way? is there some kind of more explanatory documentation of the configuration options? To be honest, its utterly confusing for a new user.

[edit2]: I also see a ton of warnings, not sure why, or if this is an issue.

The bridge shows all kinds of those, and maybe more warnings:

WRN Got error response in media retry notification for 495C7360B9CFE696571E07AE8F705F9B: GENERAL_ERROR module=Portal/.........

WRN Failed to edit $LQ2Failr0Gufom4dVPEfUQlY_AJ_tEoE4tnsivZ_I-k after retry notification for 3EB0B5975D79BD5EEBD6: failed to invite in ensure joined: failed to POST /_matrix/client/v3/rooms/!eccPJMNpiwuQVdRXJj:s710-m.mooo.com/invite: M_FORBIDDEN (HTTP 403):

WRN Failed to parse state event content to update state store error="unsupported event type com.beeper.backfill_status (state)"

WRN Failed to download media: download failed with status code 403, trying with next host... module=User/@xxxxxxx/Client

WRN Failed to download thumbnail for link preview: failed to download media from last host: download failed with status code 403 module=Portal/xxxxxxxxxxx@s.whatsapp.net

While synapse says:

synapse.handlers.message - 1447 - WARNING - POST-81371 - Denying new event <FrozenEventV3 event_id=$h1_ENA8cWO_3EUBlJPUOv9iRfr6G-2tlJJR_mmAIxPQ, type=m.room.member, state_key=@whatsapp_xxxxxxxx, outlier=False> because 403: You are not invited to this room.

Is this normal?

@patrickjane
Copy link
Author

Okay it seems that everything was synced. However, for all chats, only the last 2 days show the message senders with correct name and avatar; everything older does not have an avatar, and a generic name. Why is that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants