Separated Statistics [3/7ish]#5890
Conversation
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
erikjohnston
left a comment
There was a problem hiding this comment.
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.
This is probably going to be more up to date room state?
There was a problem hiding this comment.
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.
| ) | ||
|
|
||
| @cached() | ||
| def get_earliest_token_for_stats(self, stats_type, id): |
There was a problem hiding this comment.
Does this cache not need to be invalidated?
There was a problem hiding this comment.
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) <olivier@librepush.net>
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
`absolute_fields` being None shouldn't preclude completion of a current stats row. Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
| @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.
What does None in self.pos.values() mean?
There was a problem hiding this comment.
Adding a comment.
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
Signed-off-by: Olivier Wilkinson (reivilibre) olivier@librepush.net
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.