matrix-hacks / matrix-puppet-bridge

Facilitates implementation of double puppeted Matrix bridges
80 stars 28 forks source link

..._puppetStatusRoom: This fails. A lot. And here is why :) #70

Open IngwiePhoenix opened 4 years ago

IngwiePhoenix commented 4 years ago

After discovering (on matrix-puppet-mattermost) that usernames are lowercase, I had to also realize that this might as well apply for room names - including the status room.

Although I am basically being spammed the whole time about it, the room is never created, due to a possible mismatch of the room not existing and Synapse either refusing to create it, or creating it but in lowercase, so that the puppeting bridge can't actually join it. In fact...

image

This happens...a lot. :)

Fix: Lowercase usernames and room names.

IngwiePhoenix commented 4 years ago

I slapped an event listener for unhandled rejections in, and this showed up:

Unhandled Rejection at: Promise Promise {
  <rejected> [M_UNKNOWN_TOKEN: Invalid macaroon passed.] {
    errcode: 'M_UNKNOWN_TOKEN',
    name: 'M_UNKNOWN_TOKEN',
    message: 'Invalid macaroon passed.',
    data: {
      errcode: 'M_UNKNOWN_TOKEN',
      error: 'Invalid macaroon passed.',
      soft_logout: false
    },
    httpStatus: 401
  }
}

Now to find out what that is.

IngwiePhoenix commented 4 years ago

By tracking down the term to the Matrix API docs and all the way to the module Synapse uses - this one: https://github.com/ecordell/pymacaroons - I figured I might need to change something. So, I swapped my usual values around a little and used my outbound hostname instead of my inbound hostname (localhost:8008 vs matrix.ingwie.io) and also realized I had my URL parameter wrong. After fixing both, the Mattermost bridge is now flooding me with stuff! Eep!

Though, you might find this useful in terms of error prevention and the like. o.o