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

Remove unused DeviceRow class #6800

Merged
merged 2 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/6800.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix race in federation sender worker that delayed sending of device updates.
21 changes: 1 addition & 20 deletions synapse/federation/send_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,28 +454,9 @@ def add_to_buffer(self, buff):
buff.edus.setdefault(self.edu.destination, []).append(self.edu)


class DeviceRow(BaseFederationRow, namedtuple("DeviceRow", ("destination",))): # str
"""Streams the fact that either a) there is pending to device messages for
users on the remote, or b) a local users device has changed and needs to
be sent to the remote.
"""

TypeId = "d"

@staticmethod
def from_data(data):
return DeviceRow(destination=data["destination"])

def to_data(self):
return {"destination": self.destination}

def add_to_buffer(self, buff):
buff.device_destinations.add(self.destination)


TypeToRow = {
Row.TypeId: Row
for Row in (PresenceRow, PresenceDestinationsRow, KeyedEduRow, EduRow, DeviceRow)
for Row in (PresenceRow, PresenceDestinationsRow, KeyedEduRow, EduRow,)
}


Expand Down