Skip to content

Commit 2e844aa

Browse files
committed
Expand comment why is fine this is a cache
1 parent 815b852 commit 2e844aa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

synapse/storage/databases/main/sliding_sync.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,9 @@ def _persist_sliding_sync_connection_lazy_members_txn(
608608
# Ignore conflicts where the existing entry has a different
609609
# connection position (i.e. from a forked connection position). This
610610
# may mean that we lose some updates, but that's acceptable as this
611-
# is a cache and its fine for it to *not* include rows.
611+
# is a cache and its fine for it to *not* include rows. (Downstream
612+
# this will cause us to maybe send a few extra lazy members down
613+
# sync, but we're allowed to send extra members).
612614
sql = """
613615
INSERT INTO sliding_sync_connection_lazy_members
614616
(connection_key, connection_position, room_id, user_id, last_seen_ts)
@@ -639,7 +641,9 @@ def _persist_sliding_sync_connection_lazy_members_txn(
639641

640642
if to_remove:
641643
# We don't try and match on connection position here: it's fine to
642-
# remove it from all forks.
644+
# remove it from all forks. This is a cache so it's fine to expire
645+
# arbitrary entries, the worst that happens is we send a few extra
646+
# lazy members down sync.
643647
self.db_pool.simple_delete_many_batch_txn(
644648
txn,
645649
table="sliding_sync_connection_lazy_members",

0 commit comments

Comments
 (0)