mautrix / whatsapp

A Matrix-WhatsApp puppeting bridge
https://maunium.net/go/mautrix-whatsapp
GNU Affero General Public License v3.0
1.29k stars 175 forks source link

Ghost not leaving the room when backfilling is enabled #547

Closed hnarjis closed 2 years ago

hnarjis commented 2 years ago

I’ve set up double puppeting automatically and when enabling backfilling, some of the rooms have the Matrix ghost of my remote account, as well as my Matrix account. This happened also when setting up double puppeting manually, but it doesn’t seem to happen when backfilling is disabled.

Is this a bug or a problem with the setup? I was also wondering if there is a way to tell that the ghost account is linked to the Matrix account, since it’s supposed to replace the ghost, according to the documentation.

Here is my configuration:

matrix_mautrix_whatsapp_enabled: true
matrix_synapse_configuration_extension_yaml: |
  experimental_features:
    msc2716_enabled: true
matrix_mautrix_whatsapp_configuration_extension_yaml:
  appservice:
    ephemeral_events: true
  bridge:
    displayname_template: "{{ ' {{ if .BusinessName }} {{ .BusinessName }} {{ else if .PushName }} {{ .PushName }} {{ else if .FullName }} {{ .FullName }} {{ else }} {{ .JID }} {{ end }} ' }}"
    history_sync:
      backfill: true
      media_requests:
        auto_request_media: false
      max_initial_conversations: 15
      immediate:
        worker_count: 1
        max_events: 100
      deferred:
        # Last Week
        - start_days_ago: 7
          max_batch_events: 50
          batch_delay: 1
        # Last Month
        - start_days_ago: 30
          max_batch_events: 100
          batch_delay: 10
        # Last 3 months
        - start_days_ago: 90
          max_batch_events: 100
          batch_delay: 10
        # The start of time
        - start_days_ago: -1
          max_batch_events: 500
          batch_delay: 10
    sync_with_custom_puppets: false
    private_chat_portal_meta: true
hnarjis commented 2 years ago

It seems that setting the invite_own_puppet config to false in other bridges prevents this issue. Is it something that can be added to this bridge?

tulir commented 2 years ago

double_puppet_backfill already exists: https://github.com/mautrix/whatsapp/blob/v0.6.0/example-config.yaml#L122-L126

(requires adding yourself to the appservice namespaces though)

hnarjis commented 2 years ago

double_puppet_backfill is set to false but I still have my own puppet joining some of the rooms, it's maybe related to something else in this case?

tulir commented 2 years ago

You need to set it to true to use double puppeting for backfilling (double puppeting = using your own matrix account)

hnarjis commented 2 years ago

Ok, I'll look into it, thanks

hnarjis commented 2 years ago

It works when setting double_puppet_backfill to true and adding my user to the appservice namespaces, with exclusive set to false to prevent other issues :+1: