Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix typos and spelling errors. (#8639)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored Oct 23, 2020
1 parent c850dd9 commit 34a5696
Show file tree
Hide file tree
Showing 41 changed files with 63 additions and 60 deletions.
1 change: 1 addition & 0 deletions changelog.d/8639.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix typos and spelling errors in the code.
6 changes: 3 additions & 3 deletions docs/sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@ sso:
# and issued at ("iat") claims are validated if present.
#
# Note that this is a non-standard login type and client support is
# expected to be non-existant.
# expected to be non-existent.
#
# See https://github.com/matrix-org/synapse/blob/master/docs/jwt.md.
#
Expand Down Expand Up @@ -2402,7 +2402,7 @@ spam_checker:
#
# Options for the rules include:
#
# user_id: Matches agaisnt the creator of the alias
# user_id: Matches against the creator of the alias
# room_id: Matches against the room ID being published
# alias: Matches against any current local or canonical aliases
# associated with the room
Expand Down Expand Up @@ -2448,7 +2448,7 @@ opentracing:
# This is a list of regexes which are matched against the server_name of the
# homeserver.
#
# By defult, it is empty, so no servers are matched.
# By default, it is empty, so no servers are matched.
#
#homeserver_whitelist:
# - ".*"
Expand Down
2 changes: 1 addition & 1 deletion docs/sample_log_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ root:
# then write them to a file.
#
# Replace "buffer" with "console" to log to stderr instead. (Note that you'll
# also need to update the configuation for the `twisted` logger above, in
# also need to update the configuration for the `twisted` logger above, in
# this case.)
#
handlers: [buffer]
Expand Down
2 changes: 1 addition & 1 deletion synapse/config/jwt_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def generate_config_section(self, **kwargs):
# and issued at ("iat") claims are validated if present.
#
# Note that this is a non-standard login type and client support is
# expected to be non-existant.
# expected to be non-existent.
#
# See https://github.com/matrix-org/synapse/blob/master/docs/jwt.md.
#
Expand Down
2 changes: 1 addition & 1 deletion synapse/config/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
# then write them to a file.
#
# Replace "buffer" with "console" to log to stderr instead. (Note that you'll
# also need to update the configuation for the `twisted` logger above, in
# also need to update the configuration for the `twisted` logger above, in
# this case.)
#
handlers: [buffer]
Expand Down
2 changes: 1 addition & 1 deletion synapse/config/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def read_config(self, config, **kwargs):
RoomCreationPreset.TRUSTED_PRIVATE_CHAT,
}

# Pull the creater/inviter from the configuration, this gets used to
# Pull the creator/inviter from the configuration, this gets used to
# send invites for invite-only rooms.
mxid_localpart = config.get("auto_join_mxid_localpart")
self.auto_join_user_id = None
Expand Down
2 changes: 1 addition & 1 deletion synapse/config/room_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def generate_config_section(self, config_dir_path, server_name, **kwargs):
#
# Options for the rules include:
#
# user_id: Matches agaisnt the creator of the alias
# user_id: Matches against the creator of the alias
# room_id: Matches against the room ID being published
# alias: Matches against any current local or canonical aliases
# associated with the room
Expand Down
2 changes: 1 addition & 1 deletion synapse/config/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def generate_config_section(cls, **kwargs):
# This is a list of regexes which are matched against the server_name of the
# homeserver.
#
# By defult, it is empty, so no servers are matched.
# By default, it is empty, so no servers are matched.
#
#homeserver_whitelist:
# - ".*"
Expand Down
2 changes: 1 addition & 1 deletion synapse/crypto/context_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def get_options(self, host: bytes):
return SSLClientConnectionCreator(host, ssl_context, should_verify)

def creatorForNetloc(self, hostname, port):
"""Implements the IPolicyForHTTPS interace so that this can be passed
"""Implements the IPolicyForHTTPS interface so that this can be passed
directly to agents.
"""
return self.get_options(hostname)
Expand Down
2 changes: 1 addition & 1 deletion synapse/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __get__(self, instance, owner=None):
#
# To exclude the KeyError from the traceback, we explicitly
# 'raise from e1.__context__' (which is better than 'raise from None',
# becuase that would omit any *earlier* exceptions).
# because that would omit any *earlier* exceptions).
#
raise AttributeError(
"'%s' has no '%s' property" % (type(instance), self.key)
Expand Down
2 changes: 1 addition & 1 deletion synapse/events/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def only_fields(dictionary, fields):
in 'fields'.
If there are no event fields specified then all fields are included.
The entries may include '.' charaters to indicate sub-fields.
The entries may include '.' characters to indicate sub-fields.
So ['content.body'] will include the 'body' field of the 'content' object.
A literal '.' character in a field name may be escaped using a '\'.
Expand Down
2 changes: 1 addition & 1 deletion synapse/groups/attestations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
If a user leaves (or gets kicked out of) a group, either side can still use
their attestation to "prove" their membership, until the attestation expires.
Therefore attestations shouldn't be relied on to prove membership in important
cases, but can for less important situtations, e.g. showing a users membership
cases, but can for less important situations, e.g. showing a users membership
of groups on their profile, showing flairs, etc.
An attestation is a signed blob of json that looks like:
Expand Down
4 changes: 2 additions & 2 deletions synapse/groups/groups_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async def get_group_summary(self, group_id, requester_user_id):
entry = await self.room_list_handler.generate_room_entry(
room_id, len(joined_users), with_alias=False, allow_private=True
)
entry = dict(entry) # so we don't change whats cached
entry = dict(entry) # so we don't change what's cached
entry.pop("room_id", None)

room_entry["profile"] = entry
Expand Down Expand Up @@ -550,7 +550,7 @@ async def update_room_in_group(
group_id, room_id, is_public=is_public
)
else:
raise SynapseError(400, "Uknown config option")
raise SynapseError(400, "Unknown config option")

return {}

Expand Down
4 changes: 2 additions & 2 deletions synapse/handlers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async def export_user_data(self, user_id, writer):

# We only try and fetch events for rooms the user has been in. If
# they've been e.g. invited to a room without joining then we handle
# those seperately.
# those separately.
rooms_user_has_been_in = await self.store.get_rooms_user_has_been_in(user_id)

for index, room in enumerate(rooms):
Expand Down Expand Up @@ -226,7 +226,7 @@ def write_invite(self, room_id: str, event: FrozenEvent, state: StateMap[dict]):
"""

def finished(self):
"""Called when all data has succesfully been exported and written.
"""Called when all data has successfully been exported and written.
This functions return value is passed to the caller of
`export_user_data`.
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ async def get_access_token_for_user_id(
Creates a new access token for the user with the given user ID.
The user is assumed to have been authenticated by some other
machanism (e.g. CAS), and the user_id converted to the canonical case.
mechanism (e.g. CAS), and the user_id converted to the canonical case.
The device will be recorded in the table if it is not there already.
Expand Down
14 changes: 7 additions & 7 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class FederationHandler(BaseHandler):
"""Handles events that originated from federation.
Responsible for:
a) handling received Pdus before handing them on as Events to the rest
of the homeserver (including auth and state conflict resoultion)
of the homeserver (including auth and state conflict resolutions)
b) converting events that were produced by local clients that may need
to be sent to remote homeservers.
c) doing the necessary dances to invite remote users and join remote
Expand Down Expand Up @@ -477,7 +477,7 @@ async def _get_missing_events_for_pdu(self, origin, pdu, prevs, min_depth):
# ----
#
# Update richvdh 2018/09/18: There are a number of problems with timing this
# request out agressively on the client side:
# request out aggressively on the client side:
#
# - it plays badly with the server-side rate-limiter, which starts tarpitting you
# if you send too many requests at once, so you end up with the server carefully
Expand All @@ -495,13 +495,13 @@ async def _get_missing_events_for_pdu(self, origin, pdu, prevs, min_depth):
# we'll end up back here for the *next* PDU in the list, which exacerbates the
# problem.
#
# - the agressive 10s timeout was introduced to deal with incoming federation
# - the aggressive 10s timeout was introduced to deal with incoming federation
# requests taking 8 hours to process. It's not entirely clear why that was going
# on; certainly there were other issues causing traffic storms which are now
# resolved, and I think in any case we may be more sensible about our locking
# now. We're *certainly* more sensible about our logging.
#
# All that said: Let's try increasing the timout to 60s and see what happens.
# All that said: Let's try increasing the timeout to 60s and see what happens.

try:
missing_events = await self.federation_client.get_missing_events(
Expand Down Expand Up @@ -1120,7 +1120,7 @@ async def try_backfill(domains):
logger.info(str(e))
continue
except RequestSendFailed as e:
logger.info("Falied to get backfill from %s because %s", dom, e)
logger.info("Failed to get backfill from %s because %s", dom, e)
continue
except FederationDeniedError as e:
logger.info(e)
Expand Down Expand Up @@ -1545,7 +1545,7 @@ async def on_send_join_request(self, origin, pdu):
#
# The reasons we have the destination server rather than the origin
# server send it are slightly mysterious: the origin server should have
# all the neccessary state once it gets the response to the send_join,
# all the necessary state once it gets the response to the send_join,
# so it could send the event itself if it wanted to. It may be that
# doing it this way reduces failure modes, or avoids certain attacks
# where a new server selectively tells a subset of the federation that
Expand Down Expand Up @@ -1649,7 +1649,7 @@ async def do_remotely_reject_invite(
event.internal_metadata.outlier = True
event.internal_metadata.out_of_band_membership = True

# Try the host that we succesfully called /make_leave/ on first for
# Try the host that we successfully called /make_leave/ on first for
# the /send_leave/ request.
host_list = list(target_hosts)
try:
Expand Down
4 changes: 2 additions & 2 deletions synapse/handlers/groups_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ async def join_group(self, group_id, user_id, content):
server_name=get_domain_from_id(group_id),
)

# TODO: Check that the group is public and we're being added publically
# TODO: Check that the group is public and we're being added publicly
is_publicised = content.get("publicise", False)

token = await self.store.register_user_group_membership(
Expand Down Expand Up @@ -394,7 +394,7 @@ async def accept_invite(self, group_id, user_id, content):
server_name=get_domain_from_id(group_id),
)

# TODO: Check that the group is public and we're being added publically
# TODO: Check that the group is public and we're being added publicly
is_publicised = content.get("publicise", False)

token = await self.store.register_user_group_membership(
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ async def deduplicate_state_event(
context: The event context.
Returns:
The previous verion of the event is returned, if it is found in the
The previous version of the event is returned, if it is found in the
event context. Otherwise, None is returned.
"""
prev_state_ids = await context.get_prev_state_ids()
Expand Down
6 changes: 3 additions & 3 deletions synapse/handlers/oidc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def _uses_userinfo(self) -> bool:
This is based on the requested scopes: if the scopes include
``openid``, the provider should give use an ID token containing the
user informations. If not, we should fetch them using the
user information. If not, we should fetch them using the
``access_token`` with the ``userinfo_endpoint``.
"""

Expand Down Expand Up @@ -426,7 +426,7 @@ async def _exchange_code(self, code: str) -> Token:
return resp

async def _fetch_userinfo(self, token: Token) -> UserInfo:
"""Fetch user informations from the ``userinfo_endpoint``.
"""Fetch user information from the ``userinfo_endpoint``.
Args:
token: the token given by the ``token_endpoint``.
Expand Down Expand Up @@ -754,7 +754,7 @@ def _generate_oidc_session_token(
Defaults to an hour.
Returns:
A signed macaroon token with the session informations.
A signed macaroon token with the session information.
"""
macaroon = pymacaroons.Macaroon(
location=self._server_name, identifier="key", key=self._macaroon_secret_key,
Expand Down
4 changes: 2 additions & 2 deletions synapse/handlers/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ async def get_all_presence_updates(
between the requested tokens due to the limit.
The token returned can be used in a subsequent call to this
function to get further updatees.
function to get further updates.
The updates are a list of 2-tuples of stream ID and the row data
"""
Expand Down Expand Up @@ -977,7 +977,7 @@ def should_notify(old_state, new_state):
new_state.last_active_ts - old_state.last_active_ts
> LAST_ACTIVE_GRANULARITY
):
# Only notify about last active bumps if we're not currently acive
# Only notify about last active bumps if we're not currently active
if not new_state.currently_active:
notify_reason_counter.labels("last_active_change_online").inc()
return True
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async def get_profile(self, user_id: str) -> JsonDict:

async def get_profile_from_cache(self, user_id: str) -> JsonDict:
"""Get the profile information from our local cache. If the user is
ours then the profile information will always be corect. Otherwise,
ours then the profile information will always be correct. Otherwise,
it may be out of date/missing.
"""
target_user = UserID.from_string(user_id)
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ async def shutdown_room(
)

# We now wait for the create room to come back in via replication so
# that we can assume that all the joins/invites have propogated before
# that we can assume that all the joins/invites have propagated before
# we try and auto join below.
await self._replication.wait_for_stream_position(
self.hs.config.worker.events_shard_config.get_instance(new_room_id),
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ async def search(self, user, content, batch=None):
# Filter to apply to results
filter_dict = room_cat.get("filter", {})

# What to order results by (impacts whether pagination can be doen)
# What to order results by (impacts whether pagination can be done)
order_by = room_cat.get("order_by", "rank")

# Return the current state of the rooms?
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/state_deltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def _get_key_change(self, prev_event_id, event_id, key_name, public_value)
Returns:
None if the field in the events either both match `public_value`
or if neither do, i.e. there has been no change.
True if it didnt match `public_value` but now does
True if it didn't match `public_value` but now does
False if it did match `public_value` but now doesn't
"""
prev_event = None
Expand Down
4 changes: 2 additions & 2 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ async def compute_state_delta(
"""
# TODO(mjark) Check if the state events were received by the server
# after the previous sync, since we need to include those state
# updates even if they occured logically before the previous event.
# updates even if they occurred logically before the previous event.
# TODO(mjark) Check for new redactions in the state events.

with Measure(self.clock, "compute_state_delta"):
Expand Down Expand Up @@ -1882,7 +1882,7 @@ async def _generate_room_entry(
# members (as the client otherwise doesn't have enough info to form
# the name itself).
if sync_config.filter_collection.lazy_load_members() and (
# we recalulate the summary:
# we recalculate the summary:
# if there are membership changes in the timeline, or
# if membership has changed during a gappy sync, or
# if this is an initial sync.
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ async def get_all_typing_updates(
between the requested tokens due to the limit.
The token returned can be used in a subsequent call to this
function to get further updatees.
function to get further updates.
The updates are a list of 2-tuples of stream ID and the row data
"""
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/user_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class UserDirectoryHandler(StateDeltasHandler):
N.B.: ASSUMES IT IS THE ONLY THING THAT MODIFIES THE USER DIRECTORY
The user directory is filled with users who this server can see are joined to a
world_readable or publically joinable room. We keep a database table up to date
world_readable or publicly joinable room. We keep a database table up to date
by streaming changes of the current state and recalculating whether users should
be in the directory or not when necessary.
"""
Expand Down
2 changes: 1 addition & 1 deletion synapse/http/federation/well_known_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async def _fetch_well_known(self, server_name: bytes) -> Tuple[bytes, float]:
had_valid_well_known = self._had_valid_well_known_cache.get(server_name, False)

# We do this in two steps to differentiate between possibly transient
# errors (e.g. can't connect to host, 503 response) and more permenant
# errors (e.g. can't connect to host, 503 response) and more permanent
# errors (such as getting a 404 response).
response, body = await self._make_well_known_request(
server_name, retry=had_valid_well_known
Expand Down
Loading

0 comments on commit 34a5696

Please sign in to comment.