-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
make notification of signatures work with workers #6254
Changes from 4 commits
8ac766c
0417ca1
670972c
998f7fe
f7e4a58
9c94b48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Make notification of cross-signing signatures work with workers. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -42,14 +42,19 @@ def __init__(self, db_conn, hs): | |||||
|
||||||
def stream_positions(self): | ||||||
result = super(SlavedDeviceStore, self).stream_positions() | ||||||
result["device_lists"] = self._device_list_id_gen.get_current_token() | ||||||
result["user_signature"] = result[ | ||||||
"device_lists" | ||||||
] = self._device_list_id_gen.get_current_token() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is kind of ugly, but it's what black came up with. 🤷♂️ Alternatively, I could set result["user_signature"] and result["device_lists"] as separate statements. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
this, please. use a local temp var for the token and copy it to both fields. and add a comment to say they share a stream id. |
||||||
return result | ||||||
|
||||||
def process_replication_rows(self, stream_name, token, rows): | ||||||
if stream_name == "device_lists": | ||||||
self._device_list_id_gen.advance(token) | ||||||
for row in rows: | ||||||
self._invalidate_caches_for_devices(token, row.user_id, row.destination) | ||||||
elif stream_name == "user_signature": | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
for row in rows: | ||||||
self._user_signature_stream_cache.entity_has_changed(row.user_id, token) | ||||||
return super(SlavedDeviceStore, self).process_replication_rows( | ||||||
stream_name, token, rows | ||||||
) | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,5 +45,6 @@ | |
_base.TagAccountDataStream, | ||
_base.AccountDataStream, | ||
_base.GroupServerStream, | ||
_base.UserSignatureStream, | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the existing code isn't good for this, but I'd rather we used the symbolic constants (
UserSignatureStream.NAME
in this case) for the stream names, which makes it much easier to find the places the streams are used.