Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Be more agressive about purging old room event_push_actions #1873
Conversation
erikjohnston
assigned
NegativeMjark
Feb 1, 2017
|
Actually, the API does allow you to paginate on plain notifications, though I don't think anybody uses it. |
|
isn't this precisely what the notification tab does in riot/web?
…
|
|
@ara4n They are just highlights I thought? |
| @@ -475,7 +479,8 @@ def _remove_old_push_actions_before_txn(self, txn, room_id, user_id, | ||
| txn.execute( | ||
| "DELETE FROM event_push_actions " | ||
| " WHERE user_id = ? AND room_id = ? AND " | ||
| - " topological_ordering < ? AND stream_ordering < ?", | ||
| + " topological_ordering < ?" | ||
| + " AND ((stream_ordering < ? AND highlight = 1) or highlight = 0)", |
|
Apart from the capitalisation LGTM. The query plans before and after are:
I don't think it matters that we're losing the |
erikjohnston commentedFeb 1, 2017
There's no reason to keep a months worth of notifications after they've been read. While the pushers do use the table, they shouldn't be needing to send anything that has already been read.
We keep a months worth of highlights so that the notification API still works.