Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Some ghost user's memberships to bridge portals are missing in the dendrite database and thus said users messages are not bridged into the corresponding portal #3301

Open
mikewzr opened this issue Jan 11, 2024 · 0 comments

Comments

@mikewzr
Copy link

mikewzr commented Jan 11, 2024

Background information

  • Dendrite version or git SHA: 0.13.5+b7054f4
  • SQLite3 or Postgres?: Postgres
  • Running in Docker?: yes
  • go version: whatever version is in the upstream docker container
  • Client used (if applicable):

Description

To be more specific: A user on telegram sends a message in a group. The telegram bridge tries to bridge the message to the matrix side but fails, as dendrite returns 403 "user does not belong to room" (as seen here).

I tried investigating the issue in the database an I found that the entry in roomserver_membership membership is missing. Curiously, the last event associated with the user and the room is the join event. Thus I tried to fixes this by adding the missing entry to roomserver_membership manually. This worked, but another check fails afterwards, as the join event is not associated with the roomserver_state_snapshot anymore. The bridge gets another 403 with the message "sender <user_id> not in room". This is were I gave up, as there are hashes in the state related tables.

Steps to reproduce

Sadly I could not record when and how the ghost users get lost in the database, as I only notice the inconsistency when a message cannot be bridged anymore.

Workaround I found to get it up and running again (for telegram bridge at least)

The telegram bridge has its own database where it stores room memberships mx_user_profiles. When the entry for the ghost user and the corresponding room is deleted from this database, the telegram bridge thinks it has not added the user yet to the room. This way, when you use the sync command of the telegram bridge afterwards, the bridge re-adds the user to the room, which fixes the inconsistency in dendrite database.

@mikewzr mikewzr changed the title Some ghost user's memberships to bridge protals are missing in the dendrite database and thus so said users messges are not bridged into the corresponding portal Some ghost user's memberships to bridge protals are missing in the dendrite database and thus so said users messages are not bridged into the corresponding portal Jan 11, 2024
@mikewzr mikewzr changed the title Some ghost user's memberships to bridge protals are missing in the dendrite database and thus so said users messages are not bridged into the corresponding portal Some ghost user's memberships to bridge portals are missing in the dendrite database and thus said users messages are not bridged into the corresponding portal Jan 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant