tactilenews / 100eyes

Dialogtechnologie für den Pivot to People invented by tactile.news GmbH
MIT License
10 stars 1 forks source link

[BUG] Signal onboarding broken #1908

Closed mattwr18 closed 6 days ago

mattwr18 commented 2 weeks ago

Steps to reproduce

SignalAdapter::UnknownContributorError

Received a message on signal from an unknown sender: <UUID>

this is due to Signal not including the phone number in the first incoming message any longer. See https://github.com/AsamK/signal-cli/discussions/1414

Dev Notes

Looking into this, we seem to get the phone number if we send the welcome message first, but we also seem to get hit by rate limit challenges that need to be manually solved when sending a message to someone who has not sent to us first. These errors happen on the first message even for contributors who have gone through the normal onboarding flow and have sent us a message first. It's unclear if they would happen more often if we start sending out messages before receiving them, or not.

We also can send out messages without the phone number, using the contributor's username and I did not experience any errors for rate limiting doing this. Usernames are not visible on your profile and Signal advises to only share your username with people you trust, so it's possible that Signal does not see messages using someone's username as in need of as much spam protection.

When we send a message out to someone using the username instead of phone number, we automatically have a contact created with their uuid and username, we also have their identity added, which can be fetched with:

signal-cli --config /home/.local/share/signal-cli listIdentities

There is no need to run the SignalAdapter::CreateContactJob.

However, we still only receive their uuid with an incoming message, we do not receive their username, so we still need to find a way to associate the uuid with the contributor.

There is currently no endpoint for listContacts in signal-cli-rest-api. There is an issue https://github.com/bbernhard/signal-cli-rest-api/issues/238 that the maintainer mentions that it could be added, but it is not possible currently.

We could manually complete the onboarding by running the command in signa-cli directly; however, this is obviously less than ideal.

We could also send them an onboarding token, similar to how we do with telegram when we can't automatically complete their onboarding. Then, we could look up the contributor by their onboarding token and save their uuid for future messages.

It's not clear how many Signal users already have a username, or how easy it would be to instruct them on how to create one. See https://signal.org/blog/phone-number-privacy-usernames/

mattwr18 commented 2 weeks ago

Looking into this, we seem to get the phone number if we send the welcome message first, but we also seem to get hit by rate limit challenges that need to be manually solved when sending a message to someone who has not sent to us first.

Correction, this is not true after further testing, at least not for my contributor account. See https://tactilenews.slack.com/archives/C010QDQLCKW/p1718613388529959 for further information.