matrix-hacks / matrix-puppet-bridge

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

Use ghostIntent to get matrix profile #35

Closed twouters closed 6 years ago

twouters commented 6 years ago

This works around a race in getIntentFromThirdPartySenderId() when the setGhostAvatar() promise is called before ghostIntent.setDisplayName() is resolved.

The ghostIntent.getProfileInfo() method ensures that the matrix user exists before returning the profile.

This fixes sporadic [M_UNKNOWN: No row found] errors on messages from a new user.

Error in handleThirdPartyRoomMessage { [M_UNKNOWN: No row found]
  errcode: 'M_UNKNOWN',
  name: 'M_UNKNOWN',
  message: 'No row found',
  data: { errcode: 'M_UNKNOWN', error: 'No row found' },
  httpStatus: 404 } { roomId: '<redacted>',
  senderId: '<redacted>',
  senderName: '<redacted>',
  avatarUrl: 'https://example.org/avatar',
  text: 'example text' }

Fixes: 9846965 ("skip avatar routines unless ghost has no avatar")

twouters commented 6 years ago

Could be related to https://github.com/matrix-hacks/matrix-puppet-skype/issues/11

thomas-profitt commented 6 years ago

I'll test this in the Slack bridge soon; it has the problem.

Would you also check out the https://github.com/matrix-hacks/matrix-puppet-bridge/tree/develop branch and, if the same solution applies, create a PR to address it?

thomas-profitt commented 6 years ago

Dogfooding this as of now.