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

Commit

Permalink
Remove unused DeviceRow class (#6800)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston authored Jan 29, 2020
1 parent 281551f commit a855b7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
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

0 comments on commit a855b7c

Please sign in to comment.