summary refs log tree commit diff
path: root/synapse/storage/event_push_actions.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix some looping_call calls which were broken in #3604Richard van der Hoff2018-07-261-2/+2
| | | | | | | | | It turns out that looping_call does check the deferred returned by its callback, and (at least in the case of client_ips), we were relying on this, and I broke it in #3604. Update run_as_background_process to return the deferred, and make sure we return it to clock.looping_call.
* Wrap a number of things that run in the backgroundRichard van der Hoff2018-07-251-4/+9
| | | | | This will reduce the number of "Starting db connection from sentinel context" warnings, and will help with our metrics.
* run isortAmber Brown2018-07-091-5/+6
|
* Attempt to be more performant on PyPy (#3462)Amber Brown2018-06-281-1/+2
|
* Make push actions rotation configurableErik Johnston2018-06-221-3/+5
|
* Pass around the reactor explicitly (#3385)Amber Brown2018-06-221-2/+1
|
* replace some iteritems with sixAdrian Tschira2018-05-191-1/+3
| | | | Signed-off-by: Adrian Tschira <nota@notafile.com>
* Use stream rather depth ordering for push actionsErik Johnston2018-05-111-37/+16
| | | | | | This simplifies things as it is, but will also allow us to change the way we traverse topologically without having to update the way push actions work.
* Improve exception handling for background processesRichard van der Hoff2018-04-271-7/+17
| | | | | | | | | | | | | | | | | | There were a bunch of places where we fire off a process to happen in the background, but don't have any exception handling on it - instead relying on the unhandled error being logged when the relevent deferred gets garbage-collected. This is unsatisfactory for a number of reasons: - logging on garbage collection is best-effort and may happen some time after the error, if at all - it can be hard to figure out where the error actually happened. - it is logged as a scary CRITICAL error which (a) I always forget to grep for and (b) it's not really CRITICAL if a background process we don't care about fails. So this is an attempt to add exception handling to everything we fire off into the background.
* Merge branch 'master' of github.com:matrix-org/synapse into developErik Johnston2018-03-191-1/+1
|\
| * Replace ujson with simplejsonErik Johnston2018-03-151-1/+1
| |
* | Merge pull request #2943 from ↵Richard van der Hoff2018-03-051-12/+71
|\ \ | | | | | | | | | | | | matrix-org/rav/fix_find_first_stream_ordering_after_ts Test and fix find_first_stream_ordering_after_ts
| * | Test and fix find_first_stream_ordering_after_tsRichard van der Hoff2018-03-051-15/+53
| | | | | | | | | | | | It seemed to suffer from a bunch of off-by-one errors.
| * | Add find_first_stream_ordering_after_tsRichard van der Hoff2018-03-051-0/+21
| | | | | | | | | | | | Expose this as a public function which can be called outside a txn
* | | Fix bug with delayed cache invalidation streamErik Johnston2018-03-021-1/+1
|/ / | | | | | | | | | | We poked the notifier before updated the current token for the cache invalidation stream. This mean that sometimes the update wouldn't be sent until the next time a cache was invalidated.
* | Default stream_ordering_*_ago to NoneErik Johnston2018-03-011-2/+2
| |
* | Fix comment typoErik Johnston2018-03-011-1/+1
| |
* | Calculate stream_ordering_month_ago correctly on workersErik Johnston2018-03-011-64/+85
| |
* | Move storage functions for push calculationsErik Johnston2018-02-271-63/+63
| | | | | | | | This will allow push actions for an event to be calculated on workers.
* | Merge pull request #2892 from matrix-org/erikj/batch_inserts_push_actionsErik Johnston2018-02-261-17/+36
|\ \ | | | | | | Batch inserts into event_push_actions_staging
| * | Batch inserts into event_push_actions_stagingErik Johnston2018-02-201-17/+36
| | |
* | | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2018-02-261-88/+91
|\ \ \ | | | | | | | | | | | | erikj/handle_unpersisted_events_push
| * | | Update copyrightErik Johnston2018-02-231-0/+1
| | | |
| * | | Split out EventPushActionWorkerStoreErik Johnston2018-02-211-71/+73
| |/ /
* | | Actually use new paramErik Johnston2018-02-211-1/+3
| | |
* | | Ensure all push actions are deleted from stagingErik Johnston2018-02-201-1/+9
| | |
* | | Refactor _set_push_actions_for_event_and_users_txn to use events_and_contextsErik Johnston2018-02-201-28/+35
|/ /
* | Fix typo of double is_highlightErik Johnston2018-02-161-1/+1
| |
* | CommentsErik Johnston2018-02-161-1/+2
| |
* | Ensure that we delete staging push actions on errorsErik Johnston2018-02-151-0/+16
| |
* | Update event_push_actions table from staging tableErik Johnston2018-02-151-21/+38
| |
* | Store push actions in staging areaErik Johnston2018-02-151-0/+27
|/
* Make __init__ consitstent across Store heirarchyRichard van der Hoff2017-11-131-2/+2
| | | | | | Add db_conn parameters to the `__init__` methods of the *Store classes, so that they are all consistent, which makes the multiple inheritance work correctly (and so that we can later extract mixins which can be used in the slavedstores)
* User Cursor.__iter__ instead of fetchallErik Johnston2017-03-231-1/+1
| | | | This prevents unnecessary construction of lists
* Remove lock from rotate notifsErik Johnston2017-02-221-3/+0
|
* Store looping callErik Johnston2017-02-211-1/+3
|
* Fix up notif rotationErik Johnston2017-02-181-14/+22
|
* CommentErik Johnston2017-02-161-1/+4
|
* CommentErik Johnston2017-02-161-7/+14
|
* Store the default push actions in a more efficient mannerErik Johnston2017-02-161-11/+40
|
* Less aggressive timersErik Johnston2017-02-141-2/+2
|
* Aggregate event push actionsErik Johnston2017-02-141-57/+210
|
* Be more agressive about purging old room event_push_actionsErik Johnston2017-02-011-3/+8
|
* CommentErik Johnston2016-11-231-1/+3
|
* More efficient notif count queriesErik Johnston2016-11-231-8/+31
|
* Remove where clauseErik Johnston2016-09-121-1/+0
|
* Add WHERE clause support to index creationErik Johnston2016-09-121-1/+2
|
* Change the index to be stream_ordering, highlightErik Johnston2016-09-121-1/+1
|
* Remove unused importErik Johnston2016-09-121-1/+0
|
* Use register_background_index_updateErik Johnston2016-09-121-24/+4
|
* Add back in query changeErik Johnston2016-09-121-1/+3
|
* Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2016-09-121-3/+1
|\ | | | | | | erikj/make_notif_highlight_query_fast
| * Revert "Add index to event_push_actions"Erik Johnston2016-09-121-3/+1
| |
* | Make reindex happen in bgErik Johnston2016-09-121-0/+30
|/
* Merge remote-tracking branch 'origin/develop' into ↵David Baker2016-09-091-1/+1
|\ | | | | | | dbkr/make_notif_highlight_query_fast
| * Merge pull request #1081 from matrix-org/dbkr/notifications_only_highlightMatthew Hodgson2016-09-091-1/+8
| |\ | | | | | | Implement `only=highlight` on `/notifications`
| * | Fix /notifications API when used with `from` paramDavid Baker2016-09-081-1/+1
| | |
* | | Add index to event_push_actionsDavid Baker2016-09-091-1/+3
| |/ |/| | | | | | | | | and remove room_id caluse so it uses it Mostly from @negativemjark
* | Implement `only=highlight` on `/notifications`David Baker2016-09-081-1/+8
|/
* Merge branch 'develop' into dbkr/notifications_apiMatthew Hodgson2016-08-201-1/+1
|\
| * Remove lru optionErik Johnston2016-08-191-1/+1
| |
* | Merge remote-tracking branch 'origin/develop' into dbkr/notifications_apiDavid Baker2016-08-111-42/+188
|\|
| * Fix SQL to supply arguments in the same orderMark Haines2016-07-291-1/+1
| |
| * Create separate methods for getting messages to pushMark Haines2016-07-281-45/+154
| | | | | | | | | | | | | | | | | | | | | | for the email and http pushers rather than trying to make a single method that will work with their conflicting requirements. The http pusher needs to get the messages in ascending stream order, and doesn't want to miss a message. The email pusher needs to get the messages in descending timestamp order, and doesn't mind if it misses messages.
| * Comment get_unread_push_actions_for_user_in_range functionKegan Dougal2016-07-281-2/+26
| |
| * Use true/false for boolean parameter inclusive to avoid potential for sqli, ↵Mark Haines2016-07-051-1/+1
| | | | | | | | and possibly make the code clearer
| * Use different SQL for postgres and sqlite3 for when using multicolumn indexesMark Haines2016-07-041-9/+9
| |
| * Actually we need to order these properlyDavid Baker2016-06-221-2/+12
| | | | | | | | otherwise we'll end up returning the wrong 20
| * StyleDavid Baker2016-06-221-1/+1
| |
| * Put most recent 20 messages in notifDavid Baker2016-06-221-3/+4
| | | | | | | | Fixes https://github.com/vector-im/vector-web/issues/1648
| * Limit number of notifications in an email notificationDavid Baker2016-06-011-2/+4
| |
* | Include the ts the notif was received atDavid Baker2016-05-241-5/+7
| |
* | Add GET /notifications APIDavid Baker2016-05-231-0/+28
|/
* Remove debug loggingDavid Baker2016-05-231-1/+0
|
* Oops, missing commaDavid Baker2016-05-201-1/+1
|
* Remove stale lineDavid Baker2016-05-201-2/+0
|
* Handle empty events tableDavid Baker2016-05-201-0/+3
|
* Make deleting push actions more efficientDavid Baker2016-05-201-12/+59
| | | | There's no index on received_ts, so manually binary search using the stream_ordering index, and only update it once an hour.
* Only delete push actions after 30 daysDavid Baker2016-05-201-5/+37
|
* Merge pull request #769 from matrix-org/erikj/push_actions_deleteErik Johnston2016-05-131-0/+12
|\ | | | | Delete old pushers
| * Delete old pushersErik Johnston2016-05-031-0/+12
| |
* | Correct SQL statement for postgresDavid Baker2016-05-041-2/+3
| | | | | | | | In standard sql, join binds tighter than comma, so we were joining on the wrong table. Postgres follows the standard (apparently).
* | Remove unused functionDavid Baker2016-04-291-22/+0
| |
* | Use explicit joinDavid Baker2016-04-291-3/+3
| |
* | Oops, actually specify the user idDavid Baker2016-04-291-1/+3
| |
* | Remove unnecessary ifDavid Baker2016-04-291-1/+1
| |
* | Put spaces at start of lineDavid Baker2016-04-291-16/+16
| |
* | Send a rather basic email notifDavid Baker2016-04-201-1/+0
| | | | | | | | Also pep8 fixes
* | First bits of emailpusherDavid Baker2016-04-191-7/+50
|/ | | | Mostly logic of when to send an email
* Fix query for get_unread_push_actions_for_user_in_rangeErik Johnston2016-04-141-1/+2
|
* pep8David Baker2016-04-131-1/+1
|
* Only return unread notificationsDavid Baker2016-04-131-9/+50
| | | | Make get_unread_push_actions_for_user_in_range only return unread event actions, being more true to its name. Done in two separate sql queries to get actions after a read receipt and those in a room wiht no receipt at all. SQL queries by Erik.
* Oops, inequality failDavid Baker2016-04-071-1/+1
|
* pep8David Baker2016-04-061-1/+1
|
* Make pushers use the event_push_actions table instead of listening on an ↵David Baker2016-04-061-0/+48
| | | | | | | event stream & running the rules again. Sytest passes, but remaining to do: * Make badges work again * Remove old, unused code
* Use google style doc strings.Mark Haines2016-04-011-2/+3
| | | | | | | pycharm supports them so there is no need to use the other format. Might as well convert the existing strings to reduce the risk of people accidentally cargo culting the wrong doc string format.
* Bump get_unread_event_push_actions_by_room_for_user cacheErik Johnston2016-03-221-1/+1
|
* Remove dead code for setting device specific rules.Mark Haines2016-02-181-4/+3
| | | | | | It wasn't possible to hit the code from the API because of a typo in parsing the request path. Since no-one was using the feature we might as well remove the dead code.
* Rename functionsErik Johnston2016-02-101-2/+2
|
* Atomically persit push actions when we persist the eventErik Johnston2016-02-091-29/+16
|
* Actually return something sensibleErik Johnston2016-02-031-1/+1
|
* We return dicts now.Erik Johnston2016-02-031-1/+1
|
* Change event_push_actions_rm_tokens schemaErik Johnston2016-02-031-15/+32
|
* Make LRU cache not default to treecache & add options to use itDavid Baker2016-01-221-1/+1
|
* Use new invalidate_many cache invalidation to invalidate the ↵David Baker2016-01-221-4/+15
| | | | event_push_actions cache appropriately.
* Cache get_unread_event_push_actions_by_room_for_userErik Johnston2016-01-211-1/+2
|
* Return highlight_count in /syncErik Johnston2016-01-191-2/+3
|
* Remove the PushersTable and EventPushActionsTable objectsMark Haines2016-01-121-5/+1
|
* Delete notifications for redacted eventsDavid Baker2016-01-061-0/+12
|
* Add is_guest flag to users db to track whether a user is a guest user or ↵David Baker2016-01-061-2/+2
| | | | not. Use this so we can run _filter_events_for_client when calculating event_push_actions.
* = not == in sqlDavid Baker2016-01-041-1/+1
|
* Rename event-actions to event_push_actions as per PR requestDavid Baker2016-01-041-0/+98