From 14166f2548ee0140c6b8cb1fc1302b85cb02843a Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 7 May 2022 21:00:43 +0200 Subject: [PATCH 1/4] Fix inconsistent spelling of 'unrecognized' when refering to endpoints "M_UNRECOGNIZED" is the errcode used by in the protocol. https://github.com/matrix-org/synapse/blob/3a8ee229112697b02b876299869d7511474ecf92/synapse/api/errors.py#L34 Signed-off-by: Valentin Lorentz --- synapse/federation/federation_client.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py index b5e0b84cbc69..61709307911e 100644 --- a/synapse/federation/federation_client.py +++ b/synapse/federation/federation_client.py @@ -618,7 +618,7 @@ def _is_unknown_endpoint( # # Dendrite returns a 404 (with a body of "404 page not found"); # Conduit returns a 404 (with no body); and Synapse returns a 400 - # with M_UNRECOGNISED. + # with M_UNRECOGNIZED. # # This needs to be rather specific as some endpoints truly do return 404 # errors. @@ -1006,7 +1006,7 @@ async def _do_send_join( content=pdu.get_pdu_json(time_now), ) except HttpResponseException as e: - # If an error is received that is due to an unrecognised endpoint, + # If an error is received that is due to an unrecognized endpoint, # fallback to the v1 endpoint. Otherwise, consider it a legitimate error # and raise. if not self._is_unknown_endpoint(e): @@ -1074,7 +1074,7 @@ async def _do_send_invite( }, ) except HttpResponseException as e: - # If an error is received that is due to an unrecognised endpoint, + # If an error is received that is due to an unrecognized endpoint, # fallback to the v1 endpoint if the room uses old-style event IDs. # Otherwise, consider it a legitimate error and raise. err = e.to_synapse_error() @@ -1136,7 +1136,7 @@ async def _do_send_leave(self, destination: str, pdu: EventBase) -> JsonDict: content=pdu.get_pdu_json(time_now), ) except HttpResponseException as e: - # If an error is received that is due to an unrecognised endpoint, + # If an error is received that is due to an unrecognized endpoint, # fallback to the v1 endpoint. Otherwise, consider it a legitimate error # and raise. if not self._is_unknown_endpoint(e): @@ -1407,7 +1407,7 @@ async def send_request( suggested_only=suggested_only, ) except HttpResponseException as e: - # If an error is received that is due to an unrecognised endpoint, + # If an error is received that is due to an unrecognized endpoint, # fallback to the unstable endpoint. Otherwise, consider it a # legitimate error and raise. if not self._is_unknown_endpoint(e): From 3627f52b37e13f789eebcd76e8e42715a8a416cd Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 9 May 2022 21:42:07 +0200 Subject: [PATCH 2/4] Undo changes to other comments --- synapse/federation/federation_client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py index 61709307911e..17eff60909a2 100644 --- a/synapse/federation/federation_client.py +++ b/synapse/federation/federation_client.py @@ -1006,7 +1006,7 @@ async def _do_send_join( content=pdu.get_pdu_json(time_now), ) except HttpResponseException as e: - # If an error is received that is due to an unrecognized endpoint, + # If an error is received that is due to an unrecognised endpoint, # fallback to the v1 endpoint. Otherwise, consider it a legitimate error # and raise. if not self._is_unknown_endpoint(e): @@ -1074,7 +1074,7 @@ async def _do_send_invite( }, ) except HttpResponseException as e: - # If an error is received that is due to an unrecognized endpoint, + # If an error is received that is due to an unrecognised endpoint, # fallback to the v1 endpoint if the room uses old-style event IDs. # Otherwise, consider it a legitimate error and raise. err = e.to_synapse_error() @@ -1136,7 +1136,7 @@ async def _do_send_leave(self, destination: str, pdu: EventBase) -> JsonDict: content=pdu.get_pdu_json(time_now), ) except HttpResponseException as e: - # If an error is received that is due to an unrecognized endpoint, + # If an error is received that is due to an unrecognised endpoint, # fallback to the v1 endpoint. Otherwise, consider it a legitimate error # and raise. if not self._is_unknown_endpoint(e): @@ -1407,7 +1407,7 @@ async def send_request( suggested_only=suggested_only, ) except HttpResponseException as e: - # If an error is received that is due to an unrecognized endpoint, + # If an error is received that is due to an unrecognised endpoint, # fallback to the unstable endpoint. Otherwise, consider it a # legitimate error and raise. if not self._is_unknown_endpoint(e): From a9f64b349355900ee8b205dd0303b053ba3ab5e3 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 9 May 2022 21:43:25 +0200 Subject: [PATCH 3/4] Add changelog --- changelog.d/12665.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/12665.misc diff --git a/changelog.d/12665.misc b/changelog.d/12665.misc new file mode 100644 index 000000000000..1726a5dba0ad --- /dev/null +++ b/changelog.d/12665.misc @@ -0,0 +1 @@ +Fix spelling of UNRECOGNIZED From 830f887890737d17a1542d055a581bfe88d38d1f Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Mon, 9 May 2022 16:01:10 -0400 Subject: [PATCH 4/4] Update changelog. --- changelog.d/12665.misc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/12665.misc b/changelog.d/12665.misc index 1726a5dba0ad..37b96fea37d3 100644 --- a/changelog.d/12665.misc +++ b/changelog.d/12665.misc @@ -1 +1 @@ -Fix spelling of UNRECOGNIZED +Fix spelling of `M_UNRECOGNIZED` in comments.