mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 15:21:24 +01:00
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:
parent
5a490a4397
commit
e001356653
2 changed files with 9 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -639,8 +639,11 @@ async fn join_room_by_id_helper(
|
|||
"We couldn't do the join locally, maybe federation can help to \
|
||||
satisfy the restricted join requirements"
|
||||
);
|
||||
let (make_join_response, remote_server) =
|
||||
make_join_request(sender_user, room_id, servers).await?;
|
||||
let Ok((make_join_response, remote_server)) =
|
||||
make_join_request(sender_user, room_id, servers).await
|
||||
else {
|
||||
return Err(error);
|
||||
};
|
||||
|
||||
let room_version_id = match make_join_response.room_version {
|
||||
Some(room_version_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue