Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MadLittleMods committed Oct 16, 2024
1 parent aec7455 commit 87497c8
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions synapse/handlers/sliding_sync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
# (room_id, user_id). We don't want to store and pull out too much data in the database.
#
# 100 is an arbitrary but small-ish number. The idea is that we probably won't send down
# too many duplicate member state events for a given ongoing conversation if we keep 100
# around. Most rooms don't have 100 members and it takes a while to cycle through 100
# members.
# too many redundant member state events (that the client already knows about) for a
# given ongoing conversation if we keep 100 around. Most rooms don't have 100 members
# anyway and it takes a while to cycle through 100 members.
MAX_NUMBER_STATE_KEYS_TO_REMEMBER = 100


Expand Down Expand Up @@ -1468,7 +1468,10 @@ def _required_state_changes(
changes[event_type] = request_state_keys | inheritable_previous_state_keys
# Limit the number of state_keys we should remember sending down the connection
# for each (room_id, user_id). We don't want to store and pull out too much data
# in the database.
# in the database. This is a happy-medium between remembering nothing and
# everything. We can avoid sending redundant state down the connection most of
# the time given that most rooms don't have 100 members anyway and it takes a
# while to cycle through 100 members.
#
# Only remember up to (MAX_NUMBER_STATE_KEYS_TO_REMEMBER) state_keys
if len(changes[event_type]) > MAX_NUMBER_STATE_KEYS_TO_REMEMBER:
Expand Down Expand Up @@ -1556,7 +1559,10 @@ def _required_state_changes(
changes[event_type] = request_state_keys | inheritable_previous_state_keys
# Limit the number of state_keys we should remember sending down the connection
# for each (room_id, user_id). We don't want to store and pull out too much data
# in the database.
# in the database. This is a happy-medium between remembering nothing and
# everything. We can avoid sending redundant state down the connection most of
# the time given that most rooms don't have 100 members anyway and it takes a
# while to cycle through 100 members.
#
# Only remember up to (MAX_NUMBER_STATE_KEYS_TO_REMEMBER) state_keys
if len(changes[event_type]) > MAX_NUMBER_STATE_KEYS_TO_REMEMBER:
Expand Down

0 comments on commit 87497c8

Please sign in to comment.