element-hq / element-hq/synapse
Synapse doesn't pass errors from the identity server through to clients when verifying a phone number
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#11016](https://github.com/matrix-org/synapse/issues/11016).
---
If an identity server responds to a request with an error, e.g. with a message saying a validation token is invalid etc, Synapse doesn't pass it through to clients. Instead, it responds with a generic "Error contacting the identity server" error (with the `M_UNKNOWN` code):
https://github.com/matrix-org/synapse/blob/a0f48ee89d88fd7b6da8023dbba607a69073152e/synapse/handlers/identity.py#L631-L633
This creates a confusing user experience because clients can't do much other than printing out that generic message, which doesn't make it clear where the issue comes from:

Note that we correctly pass the error through when requesting a token for a phone number, so I don't think there should be an issue with doing the same here:
https://github.com/matrix-org/synapse/blob/a0f48ee89d88fd7b6da8023dbba607a69073152e/synapse/handlers/identity.py#L535-L537
Contributor guide
Assessment
This issue has not been assessed yet.