-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
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.
Some basic thoughts, mostly nits. I do think we should probably consider dumping the concept of "is_public", and instead let the consumer of the stats figure it out.
room_stats_complete = True | ||
|
||
elif typ == EventTypes.JoinRules: | ||
old_room_state = yield self.store.get_room_state(room_id) |
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.
This is probably going to be more up to date room state?
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.
As discussed IRL (I think – lmk if mistaken), this should be fine, as the line underneath is responsible for updating the room_stats_state
table upon which this (commented) line depends.
@@ -103,6 +193,26 @@ def update_room_state(self, room_id, fields): | |||
desc="update_room_state", | |||
) | |||
|
|||
@cached() | |||
def get_earliest_token_for_stats(self, stats_type, id): |
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.
Does this cache not need to be invalidated?
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 believe I have addressed this — but please can you check this specifically before resolving this comment? I feel like it's something that could easily bite in the bum if it's not correct.
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
`absolute_fields` being None shouldn't preclude completion of a current stats row. Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
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.
Mostly fine
@defer.inlineCallbacks | ||
def _unsafe_process(self): | ||
# If self.pos is None then means we haven't fetched it from DB | ||
if self.pos is None or None in self.pos.values(): |
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.
What does None in self.pos.values()
mean?
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.
Adding a comment.
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) [email protected]
This PR is the third in a series of PRs replacing #5847, which does the following:
These PRs will be merged into an intermediate branch (#5879) as some features may be broken if not all the PRs are applied at once.