Return local join error if all remote joins fail

If all join requests to resident servers fail or if the joining server
is the only resident server (i.e. the room is local-only), we would
previously send a 500 error, even if the more correct response would be
M_UNAUTHORIZED (e.g. if the user tries to join an invite-only room).

To fix this, we now return the error generated by attempting the join
locally, which correctly informs the client about why their request
failed.
This commit is contained in:
Andreas Fuchs 2024-10-13 20:58:52 -04:00 committed by Charles Hall
parent 5a490a4397
commit e001356653
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
2 changed files with 9 additions and 2 deletions

View file

@ -186,6 +186,10 @@ This will be the first release of Grapevine since it was forked from Conduit
([!96](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/96))
18. Fixed incoming HTTP/2 requests failing federation signature check.
([!104](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/104))
19. Return 403 instead of 500 when joins to a local-only room are denied.
Consequently fixes Heisenbridge being unable to join puppeted users to its
rooms ([#85](https://gitlab.computer.surgery/matrix/grapevine/-/issues/85)).
([!127](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/127))
### Added