Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fixup pusher pool notifications (#8287) | Erik Johnston | 2020-09-09 | 3 | -5/+18 |
| | | | | | `pusher_pool.on_new_notifications` expected a min and max stream ID, however that was not what we were passing in. Instead, let's just pass it the current max stream ID and have it track the last stream ID it got passed. I believe that it mostly worked as we called the function for every event. However, it would break for events that got persisted out of order, i.e, that were persisted but the max stream ID wasn't incremented as not all preceding events had finished persisting, and push for that event would be delayed until another event got pushed to the effected users. | ||||
* | Revert "Fixup pusher pool notifications" | Erik Johnston | 2020-09-09 | 3 | -18/+5 |
| | | | | This reverts commit e7fd336a53a4ca489cdafc389b494d5477019dc0. | ||||
* | Fixup pusher pool notifications | Erik Johnston | 2020-09-09 | 3 | -5/+18 |
| | |||||
* | Only add rows to the push actions table if the event notifies or should be ↵ | Brendan Abolivier | 2020-09-07 | 1 | -1/+6 |
| | | | | marked unread (#8274) | ||||
* | Unread counts fixes (#8254) | Brendan Abolivier | 2020-09-04 | 1 | -1/+1 |
| | | | | | | | | | | | | | | * Fixup `ALTER TABLE` database queries Make the new columns nullable, because doing otherwise can wedge a server with a big database, as setting a default value rewrites the table. * Switch back to using the notifications count in the push badge Clients are likely to be confused if we send a push but the badge count is the unread messages one, and not the notifications one. * Changelog | ||||
* | Stop sub-classing object (#8249) | Patrick Cloke | 2020-09-04 | 7 | -8/+8 |
| | |||||
* | Re-implement unread counts (again) (#8059) | Brendan Abolivier | 2020-09-02 | 2 | -29/+65 |
| | |||||
* | Use the default templates when a custom template file cannot be found (#8037) | Andrew Morgan | 2020-08-17 | 2 | -95/+8 |
| | | | Fixes https://github.com/matrix-org/synapse/issues/6583 | ||||
* | Implement new experimental push rules (#7997) | Brendan Abolivier | 2020-08-10 | 1 | -8/+208 |
|\ | | | | | With an undocumented configuration setting to enable them for specific users. | ||||
| * | Incorporate review | Brendan Abolivier | 2020-08-06 | 1 | -16/+4 |
| | | |||||
| * | Lint | Brendan Abolivier | 2020-07-30 | 1 | -19/+32 |
| | | |||||
| * | Merge branch 'develop' of github.com:matrix-org/synapse into ↵ | Brendan Abolivier | 2020-07-30 | 6 | -148/+97 |
| |\ | | | | | | | | | | babolivier/new_push_rules | ||||
| * | | Implement new experimental push rules with a database hack to enable them | Brendan Abolivier | 2020-07-28 | 1 | -9/+208 |
| | | | |||||
* | | | Revert #7736 (#8039) | Brendan Abolivier | 2020-08-06 | 1 | -4/+13 |
| | | | |||||
* | | | Convert synapse.api to async/await (#8031) | Patrick Cloke | 2020-08-06 | 1 | -1/+1 |
| |/ |/| | |||||
* | | Re-implement unread counts (#7736) | Brendan Abolivier | 2020-07-29 | 1 | -13/+4 |
| | | |||||
* | | Convert push to async/await. (#7948) | Patrick Cloke | 2020-07-27 | 6 | -139/+95 |
| | | |||||
* | | Convert state resolution to async/await (#7942) | Patrick Cloke | 2020-07-24 | 1 | -1/+3 |
|/ | |||||
* | Add ability to run multiple pusher instances (#7855) | Erik Johnston | 2020-07-16 | 1 | -36/+42 |
| | | | This reuses the same scheme as federation sender sharding | ||||
* | Allow email subjects to be customised through Synapse's configuration (#7846) | Brendan Abolivier | 2020-07-14 | 1 | -31/+20 |
| | |||||
* | Correctly pass app_name to all email templates. (#7829) | Erik Johnston | 2020-07-14 | 1 | -2/+8 |
| | | | We didn't do this for e.g. registration emails. | ||||
* | Don't ignore `set_tweak` actions with no explicit `value`. (#7766) | reivilibre | 2020-07-06 | 1 | -4/+27 |
| | | | | | | | | | | | | | | * Fix spec compliance; tweaks without values are valid (default to True, which is only concretely specified for `highlight`, but it seems only reasonable to generalise) * Changelog for 7766. * Add documentation to `tweaks_for_actions` May as well tidy up when I'm here. * Add a test for `tweaks_for_actions` | ||||
* | Hack to add push priority to push notifications (#7765) | reivilibre | 2020-07-01 | 1 | -3/+14 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove obsolete comment about ancient temporary code Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> * Implement hack to set push priority based on whether the tweaks indicate the event might cause effects. * Changelog for 7765 Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> * Antilint * Add tests for push priority Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> * Update synapse/push/httppusher.py Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Antilint * Remove needless invites from tests. Co-authored-by: Brendan Abolivier <babolivier@matrix.org> | ||||
* | Back out MSC2625 implementation (#7761) | Brendan Abolivier | 2020-07-01 | 2 | -9/+3 |
| | |||||
* | add a comment | Richard van der Hoff | 2020-06-18 | 1 | -0/+2 |
| | |||||
* | Fix unread counts in sync | Brendan Abolivier | 2020-06-17 | 1 | -1/+1 |
| | | | | | * Always return an unread_count in get_unread_event_push_actions_by_room_for_user * Don't always expect unread_count to be there so we don't take out sync entirely if something goes wrong | ||||
* | Implement unread counter (MSC2625) (#7673) | Brendan Abolivier | 2020-06-17 | 2 | -3/+9 |
|\ | | | | | Implementation of https://github.com/matrix-org/matrix-doc/pull/2625 | ||||
| * | Merge branch 'develop' into babolivier/mark_unread | Brendan Abolivier | 2020-06-15 | 1 | -8/+6 |
| |\ | |||||
| * | | Incorporate review bits | Brendan Abolivier | 2020-06-12 | 1 | -7/+6 |
| | | | |||||
| * | | Actually act on mark_unread | Brendan Abolivier | 2020-06-11 | 1 | -3/+7 |
| | | | |||||
| * | | Add a new unread_counter to sync responses | Brendan Abolivier | 2020-06-10 | 1 | -1/+4 |
| | | | |||||
* | | | Refactor getting replication updates from database. (#7636) | Erik Johnston | 2020-06-16 | 1 | -3/+1 |
| | | | | | | | | | The aim here is to make it easier to reason about when streams are limited and when they're not, by moving the logic into the database functions themselves. This should mean we can kill of `db_query_to_update_function` function. | ||||
* | | | Replace all remaining six usage with native Python 3 equivalents (#7704) | Dagfinn Ilmari Mannsåker | 2020-06-16 | 2 | -5/+2 |
| | | | |||||
* | | | Ensure the body is a string before comparing push rules. (#7701) | Patrick Cloke | 2020-06-15 | 1 | -2/+2 |
| |/ |/| | |||||
* | | Replace iteritems/itervalues/iterkeys with native versions. (#7692) | Patrick Cloke | 2020-06-15 | 1 | -8/+6 |
|/ | |||||
* | Convert sending mail to async/await. (#7557) | Erik Johnston | 2020-05-22 | 2 | -69/+53 |
| | | | | Mainly because sometimes the email push code raises exceptions where the stack traces have gotten lost, which is hopefully fixed by this. | ||||
* | remove miscellaneous PY2 code | Richard van der Hoff | 2020-05-15 | 1 | -8/+3 |
| | |||||
* | Fix new flake8 errors (#7470) | Erik Johnston | 2020-05-12 | 1 | -2/+5 |
| | |||||
* | Allow configuration of Synapse's cache without using synctl or environment ↵ | Amber Brown | 2020-05-11 | 2 | -3/+5 |
| | | | | variables (#6391) | ||||
* | Do not treat display names as globs for push rules. (#7271) | Patrick Cloke | 2020-04-16 | 1 | -30/+39 |
| | |||||
* | Fix concurrent modification errors in pusher metrics (#7106) | Richard van der Hoff | 2020-03-19 | 1 | -9/+18 |
| | | | add a lock to try to make this metric actually work | ||||
* | Add prometheus metrics for the number of active pushers (#7103) | Richard van der Hoff | 2020-03-19 | 1 | -1/+23 |
| | |||||
* | Fix undefined `room_id` in `make_summary_text` | Brendan Abolivier | 2020-03-09 | 1 | -1/+3 |
| | | | | | This would break notifications about un-named rooms when processing notifications in a batch. | ||||
* | No longer use room alias events to calculate room names for push ↵ | Patrick Cloke | 2020-02-21 | 1 | -22/+14 |
| | | | | notifications. (#6966) | ||||
* | Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957) | Patrick Cloke | 2020-02-21 | 4 | -18/+14 |
| | | | | Ensure good comprehension hygiene using flake8-comprehensions. | ||||
* | Reduce amount of logging at INFO level. (#6862) | Erik Johnston | 2020-02-06 | 1 | -1/+1 |
| | | | | | | | | A lot of the things we log at INFO are now a bit superfluous, so lets make them DEBUG logs to reduce the amount we log by default. Co-Authored-By: Brendan Abolivier <babolivier@matrix.org> Co-authored-by: Brendan Abolivier <github@brendanabolivier.com> | ||||
* | Add `local_current_membership` table (#6655) | Erik Johnston | 2020-01-15 | 1 | -1/+1 |
| | | | | | | | Currently we rely on `current_state_events` to figure out what rooms a user was in and their last membership event in there. However, if the server leaves the room then the table may be cleaned up and that information is lost. So lets add a table that separately holds that information. | ||||
* | Change EventContext to use the Storage class (#6564) | Erik Johnston | 2019-12-20 | 1 | -2/+2 |
| | |||||
* | Clean up startup for the pusher (#6558) | Richard van der Hoff | 2019-12-18 | 2 | -9/+13 |
| | | | | | | | | | | | | | | | | | | | | | | | * Remove redundant python2 support code `str.decode()` doesn't exist on python3, so presumably this code was doing nothing * Filter out pushers with corrupt data When we get a row with unparsable json, drop the row, rather than returning a row with null `data`, which will then cause an explosion later on. * Improve logging when we can't start a pusher Log the ID to help us understand the problem * Make email pusher setup more robust We know we'll have a `data` member, since that comes from the database. What we *don't* know is if that is a dict, and if that has a `brand` member, and if that member is a string. | ||||
* | Don't call SQLBaseStore methods from outside stores | Erik Johnston | 2019-12-04 | 1 | -9/+1 |
| | |||||
* | Clean up newline quote marks around the codebase (#6362) | Andrew Morgan | 2019-11-21 | 2 | -5/+4 |
| | |||||
* | Support for routing outbound HTTP requests via a proxy (#6239) | Richard van der Hoff | 2019-11-01 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | The `http_proxy` and `HTTPS_PROXY` env vars can be set to a `host[:port]` value which should point to a proxy. The address of the proxy should be excluded from IP blacklists such as the `url_preview_ip_range_blacklist`. The proxy will then be used for * push * url previews * phone-home stats * recaptcha validation * CAS auth validation It will *not* be used for: * Application Services * Identity servers * Outbound federation * In worker configurations, connections from workers to masters Fixes #4198. | ||||
* | Update black to 19.10b0 (#6304) | Amber Brown | 2019-11-01 | 4 | -22/+17 |
| | | | * update version of black and also fix the mypy config being overridden | ||||
* | Merge pull request #6294 from matrix-org/erikj/add_state_storage | Erik Johnston | 2019-10-31 | 3 | -6/+9 |
|\ | | | | | Add StateGroupStorage interface | ||||
| * | Port to use state storage | Erik Johnston | 2019-10-30 | 3 | -6/+9 |
| | | |||||
* | | Remove usage of deprecated logger.warn method from codebase (#6271) | Andrew Morgan | 2019-10-31 | 2 | -4/+4 |
|/ | | | Replace every instance of `logger.warn` with `logger.warning` as the former is deprecated. | ||||
* | Quick fix to ensure cache descriptors always return deferreds | Erik Johnston | 2019-10-28 | 1 | -1/+1 |
| | |||||
* | Generalize email sending logging (#6075) | Andrew Morgan | 2019-09-23 | 1 | -1/+1 |
| | | | | | | | In ancient times Synapse would only send emails when it was notifying a user about a message they received... Now it can do all sorts of neat things! Change the logging so it's not just about notifications. | ||||
* | Allow HS to send emails when adding an email to the HS (#6042) | Andrew Morgan | 2019-09-20 | 1 | -0/+29 |
| | |||||
* | Ensure email validation link parameters are URL-encoded (#6063) | Andrew Morgan | 2019-09-20 | 1 | -4/+6 |
| | | | The validation links sent via email had their query parameters inserted without any URL-encoding. Surprisingly this didn't seem to cause any issues, but if a user were to put a `/` in their client_secret it could lead to problems. | ||||
* | Add opentracing span for HTTP push | Erik Johnston | 2019-09-09 | 1 | -1/+12 |
| | |||||
* | Allow Synapse to send registration emails + choose Synapse or an external ↵ | Andrew Morgan | 2019-09-06 | 2 | -23/+77 |
| | | | | | | | | | | | | | | | | server to handle 3pid validation (#5987) This is a combination of a few different PRs, finally all being merged into `develop`: * #5875 * #5876 * #5868 (This one added the `/versions` flag but the flag itself was actually [backed out](https://github.com/matrix-org/synapse/commit/891afb57cbdf9867f2848341b29c75d6f35eef5a#diff-e591d42d30690ffb79f63bb726200891) in #5969. What's left is just giving /versions access to the config file, which could be useful in the future) * #5835 * #5969 * #5940 Clients should not actually use the new registration functionality until https://github.com/matrix-org/synapse/pull/5972 is merged. UPGRADE.rst, changelog entries and config file changes should all be reviewed closely before this PR is merged. | ||||
* | Remove unnecessary parentheses around return statements (#5931) | Andrew Morgan | 2019-08-30 | 1 | -1/+1 |
| | | | | | Python will return a tuple whether there are parentheses around the returned values or not. I'm just sick of my editor complaining about this all over the place :) | ||||
* | Remove redundant return | Erik Johnston | 2019-08-13 | 1 | -1/+0 |
| | |||||
* | Handle pusher being deleted during processing. | Erik Johnston | 2019-08-01 | 2 | -13/+33 |
| | | | | | Instead of throwing a StoreError lets break out of processing loop and mark the pusher as stopped. | ||||
* | Explicitly check that tombstone is a state event before notifying. | Erik Johnston | 2019-07-31 | 1 | -1/+7 |
| | |||||
* | Replace returnValue with return (#5736) | Amber Brown | 2019-07-23 | 6 | -82/+65 |
| | |||||
* | Add default push rule to ignore reactions (#5623) | J. Ryan Stinnett | 2019-07-05 | 1 | -0/+13 |
| | | | | | | | This adds a default push rule following the proposal in [MSC2153](https://github.com/matrix-org/matrix-doc/pull/2153). See also https://github.com/vector-im/riot-web/issues/10208 See also https://github.com/matrix-org/matrix-js-sdk/pull/976 | ||||
* | Move logging utilities out of the side drawer of util/ and into logging/ (#5606) | Amber Brown | 2019-07-04 | 1 | -1/+1 |
| | |||||
* | Improve email notification logging (#5502) | Neil Johnson | 2019-06-20 | 1 | -1/+1 |
| | |||||
* | Run Black. (#5482) | Amber Brown | 2019-06-20 | 13 | -697/+675 |
| | |||||
* | Merge pull request #5388 from matrix-org/erikj/fix_email_push | Erik Johnston | 2019-06-17 | 3 | -7/+53 |
|\ | | | | | Fix email notifications for unnamed rooms with multiple people | ||||
| * | Add test | Erik Johnston | 2019-06-07 | 2 | -7/+42 |
| | | |||||
| * | Fix email notifications for large unnamed rooms. | Erik Johnston | 2019-06-07 | 1 | -0/+11 |
| | | | | | | | | | | | | When we try and calculate a description for a room for with no name but multiple other users we threw an exception (due to trying to subscript result of `dict.values()`). | ||||
* | | Change password reset links to /_matrix. | Erik Johnston | 2019-06-11 | 1 | -1/+1 |
|/ | |||||
* | Add ability to perform password reset via email without trusting the ↵ | Andrew Morgan | 2019-06-06 | 2 | -20/+69 |
| | | | | | | | | | | | | identity server (#5377) Sends password reset emails from the homeserver instead of proxying to the identity server. This is now the default behaviour for security reasons. If you wish to continue proxying password reset requests to the identity server you must now enable the email.trust_identity_server_for_password_resets option. This PR is a culmination of 3 smaller PRs which have each been separately reviewed: * #5308 * #5345 * #5368 | ||||
* | Add a default .m.rule.tombstone push rule (#4867) | Travis Ralston | 2019-04-29 | 1 | -0/+17 |
| | | | | | | | | | | * Add a default .m.rule.tombstone push rule In support of MSC1930: https://github.com/matrix-org/matrix-doc/pull/1930 * changelog * Appease the changelog linter | ||||
* | Merge pull request #5047 from matrix-org/babolivier/account_expiration | Brendan Abolivier | 2019-04-17 | 2 | -10/+10 |
|\ | | | | | Send out emails with links to extend an account's validity period | ||||
| * | Send out emails with links to extend an account's validity period | Brendan Abolivier | 2019-04-17 | 2 | -10/+10 |
| | | |||||
* | | Make starting pushers faster during start up | Erik Johnston | 2019-04-02 | 3 | -8/+43 |
|/ | | | | | | | | | | | We start all pushers on start up and immediately start a background process to fetch push to send. This makes start up incredibly painful when dealing with many pushers. Instead, let's do a quick fast DB check to see if there *may* be push to send and only start the background processes for those pushers. We also stagger starting up and doing those checks so that we don't try and handle all pushers at once. | ||||
* | Add missing return | Erik Johnston | 2019-02-22 | 1 | -0/+1 |
| | |||||
* | Correctly handle PusherConfigException | Erik Johnston | 2019-02-22 | 1 | -0/+9 |
| | |||||
* | Drop logging level of creating a pusher | Erik Johnston | 2019-02-22 | 1 | -1/+1 |
| | |||||
* | Correctly handle null data in HttpPusher | Erik Johnston | 2019-02-22 | 1 | -0/+5 |
| | |||||
* | Add prometheus metrics for number of badge update pushes. (#4709) | Richard van der Hoff | 2019-02-22 | 1 | -8/+25 |
| | | | | | | We're counting the number of push notifications, but not the number of badges; I'd like to see if they are significant. | ||||
* | bail out early in on_new_receipts if no pushers (#4706) | Richard van der Hoff | 2019-02-21 | 1 | -0/+8 |
| | |||||
* | Logging improvements for the pusher (#4691) | Richard van der Hoff | 2019-02-20 | 2 | -13/+14 |
| | |||||
* | Fix flake8 (#4519) | Amber Brown | 2019-01-30 | 1 | -1/+1 |
| | |||||
* | Fix logcontext leak in EmailPusher | Richard van der Hoff | 2018-11-19 | 1 | -2/+3 |
| | |||||
* | Clean up event accesses and tests | Erik Johnston | 2018-11-02 | 2 | -4/+4 |
| | | | | | This is in preparation to refactor FrozenEvent to support different event formats for different room versions | ||||
* | Write some tests for the email pusher (#4095) | Amber Brown | 2018-10-30 | 2 | -6/+9 |
| | |||||
* | Fix start_pushers vs _start_pushers confusion | Richard van der Hoff | 2018-10-24 | 1 | -3/+3 |
| | |||||
* | sanity-check the is_processing flag | Richard van der Hoff | 2018-10-24 | 2 | -8/+14 |
| | | | | ... and rename it, for even more sanity | ||||
* | Run PusherPool.start as a background process | Richard van der Hoff | 2018-10-22 | 1 | -5/+7 |
| | | | | | We don't do anything with the result, so this is needed to give this code a logcontext. | ||||
* | Make on_started synchronous too | Richard van der Hoff | 2018-10-22 | 3 | -11/+21 |
| | | | | | | This brings it into line with on_new_notifications and on_new_receipts. It requires a little bit of hoop-jumping in EmailPusher to load the throttle params before the first loop. | ||||
* | Remove redundant run_as_background_process() from pusherpool | Richard van der Hoff | 2018-10-22 | 3 | -44/+8 |
| | | | | | | | `on_new_notifications` and `on_new_receipts` in `HttpPusher` and `EmailPusher` now always return synchronously, so we can remove the `defer.gatherResults` on their results, and the `run_as_background_process` wrappers can be removed too because the PusherPool methods will now complete quickly enough. | ||||
* | Give pushers their own background logcontext | Richard van der Hoff | 2018-10-22 | 2 | -58/+54 |
| | | | | | | | | Each pusher has its own loop which runs for as long as it has work to do. This should run in its own background thread with its own logcontext, as other similar loops elsewhere in the system do - which means that CPU usage is consistently attributed to that loop, rather than to whatever request happened to start the loop. | ||||
* | move get_all_pushers call down | Richard van der Hoff | 2018-10-22 | 1 | -3/+9 |
| | | | | simplifies the interface to _start_pushers | ||||
* | Factor PusherPool._start_pusher out of _start_pushers | Richard van der Hoff | 2018-10-22 | 1 | -18/+33 |
| | | | | | ... and use it from start_pusher_by_id. This mostly simplifies start_pusher_by_id. | ||||
* | Rename _refresh_pusher | Richard van der Hoff | 2018-10-22 | 1 | -2/+3 |
| | | | | | This is public (or at least, called from outside the class), so ought to have a better name. | ||||
* | Calculate absolute path for email templates | Richard van der Hoff | 2018-10-19 | 1 | -6/+2 |
| | |||||
* | Ship the email templates as package_data | Richard van der Hoff | 2018-10-17 | 1 | -1/+4 |
| | | | | | | | | | | move the example email templates into the synapse package so that they can be used as package data, which should mean that all of the packaging mechanisms (pip, docker, debian, arch, etc) should now come with the example templates. In order to grandfather in people who relied on the templates being in the old place, check for that situation and fall back to using the defaults if the templates directory does not exist. | ||||
* | fix link for case that config.email_riot_base_url is set | Neil Johnson | 2018-09-13 | 1 | -1/+1 |
| | |||||
* | merge (#3576) | Amber Brown | 2018-09-14 | 2 | -4/+10 |
| | |||||
* | Fix logcontexts for running pushers | Richard van der Hoff | 2018-08-17 | 1 | -2/+15 |
| | | | | | | | First of all, avoid resetting the logcontext before running the pushers, to fix the "Starting db txn 'get_all_updated_receipts' from sentinel context" warning. Instead, give them their own "background process" logcontexts. | ||||
* | Rename async to async_helpers because `async` is a keyword on Python 3.7 (#3678) | Amber Brown | 2018-08-10 | 2 | -2/+2 |
| | |||||
* | Use new getters | Erik Johnston | 2018-07-23 | 1 | -3/+4 |
| | |||||
* | run isort | Amber Brown | 2018-07-09 | 11 | -48/+48 |
| | |||||
* | Remove all global reactor imports & pass it around explicitly (#3424) | Amber Brown | 2018-06-25 | 2 | -4/+6 |
| | |||||
* | Remove run_on_reactor (#3395) | Amber Brown | 2018-06-14 | 1 | -3/+0 |
| | |||||
* | Consistently use six's iteritems and wrap lazy keys/values in list() if ↵ | Amber Brown | 2018-05-31 | 3 | -3/+4 |
| | | | | they're not meant to be lazy (#3307) | ||||
* | Merge remote-tracking branch 'origin/develop' into 3218-official-prom | Amber Brown | 2018-05-28 | 2 | -7/+10 |
|\ | |||||
| * | Merge pull request #3244 from NotAFile/py3-six-4 | Amber Brown | 2018-05-24 | 1 | -6/+7 |
| |\ | | | | | | | replace some iteritems with six | ||||
| | * | replace some iteritems with six | Adrian Tschira | 2018-05-19 | 1 | -6/+7 |
| | | | | | | | | | | | | Signed-off-by: Adrian Tschira <nota@notafile.com> | ||||
| * | | Replace some more comparisons with six | Adrian Tschira | 2018-05-19 | 1 | -1/+3 |
| |/ | | | | | | | | | | | plus a bonus b"" string I missed last time Signed-off-by: Adrian Tschira <nota@notafile.com> | ||||
* | | fixes | Amber Brown | 2018-05-23 | 1 | -2/+2 |
| | | |||||
* | | cleanup | Amber Brown | 2018-05-22 | 1 | -2/+4 |
| | | |||||
* | | fixes | Amber Brown | 2018-05-22 | 1 | -2/+2 |
| | | |||||
* | | rest of the changes | Amber Brown | 2018-05-21 | 1 | -17/+11 |
| | | |||||
* | | replacing portions | Amber Brown | 2018-05-21 | 2 | -10/+5 |
|/ | |||||
* | Merge pull request #3152 from NotAFile/py3-local-imports | Richard van der Hoff | 2018-04-30 | 2 | -3/+3 |
|\ | | | | | make imports local | ||||
| * | make imports local | Adrian Tschira | 2018-04-28 | 2 | -3/+3 |
| | | | | | | | | Signed-off-by: Adrian Tschira <nota@notafile.com> | ||||
* | | Merge remote-tracking branch 'origin/develop' into rav/use_run_in_background | Richard van der Hoff | 2018-04-27 | 3 | -7/+17 |
|\| | |||||
| * | Merge pull request #3138 from matrix-org/rav/catch_unhandled_exceptions | Richard van der Hoff | 2018-04-27 | 2 | -5/+11 |
| |\ | | | | | | | Improve exception handling for background processes | ||||
| | * | Improve exception handling for background processes | Richard van der Hoff | 2018-04-27 | 2 | -5/+11 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
| * | | Add missing consumeErrors | Richard van der Hoff | 2018-04-27 | 1 | -2/+6 |
| |/ | | | | | | | | | In general we want defer.gatherResults to consumeErrors, rather than having exceptions hanging around and getting logged as CRITICAL unhandled errors. | ||||
* / | Use run_in_background in preference to preserve_fn | Richard van der Hoff | 2018-04-27 | 1 | -8/+12 |
|/ | | | | | | While I was going through uses of preserve_fn for other PRs, I converted places which only use the wrapped function once to use run_in_background, to avoid creating the function object. | ||||
* | Update comments | Erik Johnston | 2018-02-21 | 1 | -3/+4 |
| | |||||
* | Batch inserts into event_push_actions_staging | Erik Johnston | 2018-02-20 | 1 | -6/+9 |
| | |||||
* | Comments | Erik Johnston | 2018-02-16 | 1 | -0/+3 |
| | |||||
* | Remove context.push_actions | Erik Johnston | 2018-02-15 | 2 | -11/+4 |
| | |||||
* | Store push actions in staging area | Erik Johnston | 2018-02-15 | 1 | -0/+3 |
| | |||||
* | Better logging when pushes fail | Richard van der Hoff | 2018-01-29 | 1 | -2/+8 |
| | |||||
* | add appid/device_display_name to to pusher logging | Richard van der Hoff | 2018-01-29 | 1 | -2/+2 |
| | |||||
* | Fix logging and add user_id | Richard van der Hoff | 2018-01-22 | 1 | -2/+3 |
| | |||||
* | logging and debug for http pusher | Richard van der Hoff | 2018-01-22 | 1 | -4/+20 |
| | |||||
* | Remove pushers when deleting access tokens | Richard van der Hoff | 2017-11-29 | 1 | -9/+15 |
| | | | | | Whenever an access token is invalidated, we should remove the associated pushers. | ||||
* | Merge pull request #2675 from matrix-org/rav/remove_broken_logcontext_funcs | Richard van der Hoff | 2017-11-15 | 1 | -3/+3 |
|\ | | | | | Remove preserve_context_over_{fn, deferred} | ||||
| * | Remove preserve_context_over_{fn, deferred} | Richard van der Hoff | 2017-11-14 | 1 | -3/+3 |
| | | | | | | | | | | Both of these functions ae known to leak logcontexts. Replace the remaining calls to them and kill them off. | ||||
* | | Rename redact_content option to include_content | David Baker | 2017-11-08 | 1 | -1/+2 |
|/ | | | | | | | | | | | | | | | | | | The redact_content option never worked because it read the wrong config section. The PR introducing it (https://github.com/matrix-org/synapse/pull/2301) had feedback suggesting the name be changed to not re-use the term 'redact' but this wasn't incorporated. This reanmes the option to give it a less confusing name, and also means that people who've set the redact_content option won't suddenly see a behaviour change when upgrading synapse, but instead can set include_content if they want to. This PR also updates the wording of the config comment to clarify that this has no effect on event_id_only push. Includes https://github.com/matrix-org/synapse/pull/2422 | ||||
* | replace 'except:' with 'except Exception:' | Richard van der Hoff | 2017-10-23 | 4 | -8/+8 |
| | | | | what could possibly go wrong | ||||
* | Omit the *s for @room notifications | David Baker | 2017-10-16 | 1 | -1/+1 |
| | | | | They're just redundant | ||||
* | pep8 | David Baker | 2017-10-10 | 2 | -3/+5 |
| | |||||
* | Don't KeyError if no power_levels event | David Baker | 2017-10-10 | 1 | -1/+3 |
| | |||||
* | Use notification levels in power_levels | David Baker | 2017-10-10 | 3 | -12/+22 |
| | | | | | | Rather than making the condition directly require a specific power level. This way the level require to notify a room can be configured per room. | ||||
* | There was already a constant for this | David Baker | 2017-10-10 | 1 | -3/+4 |
| | | | | also update copyright | ||||
* | More optimisation | David Baker | 2017-10-10 | 1 | -6/+9 |
| | |||||
* | What year is it!? Who's the president!? | David Baker | 2017-10-10 | 1 | -1/+1 |
| | |||||
* | Make be faster | David Baker | 2017-10-05 | 1 | -3/+3 |
| | |||||
* | Add fastpath optimisation | David Baker | 2017-10-05 | 1 | -3/+9 |
| | |||||
* | pep8 | David Baker | 2017-10-05 | 1 | -0/+3 |
| | |||||
* | They're called rooms | David Baker | 2017-10-05 | 1 | -4/+4 |
| | |||||
* | Get rule type right | David Baker | 2017-10-05 | 1 | -1/+1 |
| | |||||
* | Support for channel notifications | David Baker | 2017-10-05 | 3 | -8/+59 |
| | | | | | Add condition type to check the sender's power level and add a base rule using it for @channel notifications. | ||||
* | Use better method for word boundary searching | David Baker | 2017-10-05 | 1 | -11/+3 |
| | | | | From https://github.com/matrix-org/matrix-js-sdk/commit/ebc95667b8a5777d13e5d3c679972bedae022fd5 | ||||
* | pep8 | David Baker | 2017-10-05 | 1 | -0/+1 |
| | |||||
* | Fix notif kws that start/end with non-word chars | David Baker | 2017-10-05 | 1 | -2/+21 |
| | | | | | | | Only prepend / append word bounary characters if the search expression starts or ends with a word character, otherwise they don't work because there's no word bounary between whitespace and a non-word char. | ||||
* | Also include the room_id | David Baker | 2017-09-18 | 1 | -0/+1 |
| | | | | as really it's part of the event ID | ||||
* | Use .get - it's much shorter | David Baker | 2017-09-18 | 1 | -1/+1 |
| | |||||
* | Add support for event_id_only push format | David Baker | 2017-09-18 | 1 | -0/+19 |
| | | | | | | | Param in the data dict of a pusher that tells an HTTP pusher to send just the event_id of the event it's notifying about and the notification counts. For clients that want to go & fetch the body of the event themselves anyway. | ||||
* | Increase cache hit ratio for push | Erik Johnston | 2017-07-14 | 1 | -0/+8 |
| | | | | | We don't update the cache in all code paths, which causes subsequent calls to miss the cache | ||||
* | Add more metrics to push rule evaluation | Erik Johnston | 2017-07-13 | 1 | -2/+42 |
| | |||||
* | Push: Don't acquire lock unless necessary | Erik Johnston | 2017-07-13 | 1 | -0/+4 |
| | |||||
* | Perf: Don't filter events for push | Erik Johnston | 2017-07-07 | 1 | -17/+8 |
| | | | | | We know the users are joined and we can explicitly check for if they are ignoring the user, so lets do that. | ||||
* | Merge pull request #2332 from matrix-org/rav/fix_pushes | Richard van der Hoff | 2017-07-05 | 1 | -1/+3 |
|\ | | | | | Fix caching error in the push evaluator | ||||
| * | Fix caching error in the push evaluator | Richard van der Hoff | 2017-07-05 | 1 | -1/+3 |
| | | | | | | | | | | | | | | | | | | | | Initialising `result` to `{}` in the parameters meant that every call to _flatten_dict used the *same* target dictionary. I'm hopeful this will fix https://github.com/matrix-org/synapse/issues/2270, but I suspect it won't. (This code seems to have been here since forever, unlike the bug, and I don't really think it explains the observed behaviour). Still, it makes it hard to investigate the problem. | ||||
* | | Fix TravisCI tests for PR #2301 | Caleb James DeLisle | 2017-06-23 | 1 | -1/+1 |
| | | |||||
* | | Add configuration parameter to allow redaction of content from push messages ↵ | Caleb James DeLisle | 2017-06-23 | 1 | -1/+1 |
|/ | | | | for google/apple devices | ||||
* | Fix typo when getting app name | Erik Johnston | 2017-06-06 | 1 | -1/+1 |
| | |||||
* | Fix wrong number of arguments | Erik Johnston | 2017-06-06 | 1 | -1/+1 |
| | |||||
* | Only load jinja2 templates once | Erik Johnston | 2017-05-22 | 4 | -60/+105 |
| | | | | | Instead of every time a new email pusher is created, as loading jinja2 templates is slow. | ||||
* | Comment | Erik Johnston | 2017-05-22 | 1 | -0/+2 |
| | |||||
* | Remove spurious log level guards | Erik Johnston | 2017-05-22 | 1 | -6/+3 |
| | |||||
* | Check if current event is a membership event | Erik Johnston | 2017-05-22 | 1 | -4/+9 |
| | |||||
* | Add debug logging | Erik Johnston | 2017-05-22 | 1 | -0/+24 |
| | |||||
* | Comment | Erik Johnston | 2017-05-22 | 1 | -1/+4 |
| | |||||
* | Use tuple unpacking | Erik Johnston | 2017-05-22 | 1 | -2/+2 |
| | |||||
* | Speed up calculating push rules | Erik Johnston | 2017-05-19 | 1 | -8/+19 |
| | |||||
* | Move invalidation cb to its own structure | Erik Johnston | 2017-05-19 | 1 | -6/+15 |
| | |||||
* | Store ActionGenerator in HomeServer | Erik Johnston | 2017-05-19 | 2 | -2/+2 |
| | |||||
* | Don't push users who have left | Erik Johnston | 2017-05-18 | 1 | -1/+4 |
| | |||||
* | Make get_if_app_services_interested_in_user faster | Erik Johnston | 2017-05-18 | 1 | -3/+1 |
| | |||||
* | Remove size of push get_rules cache | Erik Johnston | 2017-05-18 | 1 | -1/+1 |
| | |||||
* | Add comment | Erik Johnston | 2017-05-18 | 1 | -0/+3 |
| | |||||
* | Faster push rule calculation via push specific cache | Erik Johnston | 2017-05-17 | 2 | -45/+246 |
| | | | | | We add a push rule specific cache that ensures that we can reuse calculated push rules appropriately when a user join/leaves. | ||||
* | Revert "Speed up filtering of a single event in push" | Erik Johnston | 2017-05-08 | 1 | -8/+19 |
| | | | | This reverts commit 421fdf74609439edaaffce117436e6a6df147841. | ||||
* | Speed up filtering of a single event in push | Erik Johnston | 2017-04-28 | 1 | -19/+8 |
| | |||||
* | fix up | Erik Johnston | 2017-04-25 | 1 | -1/+2 |
| | |||||
* | Don't specify default as dict | Erik Johnston | 2017-04-25 | 1 | -1/+1 |
| | |||||
* | Reduce size of joined_user cache | Erik Johnston | 2017-04-25 | 1 | -2/+5 |
| | | | | | | | | The _get_joined_users_from_context cache stores a mapping from user_id to avatar_url and display_name. Instead of storing those in a dict, store them in a namedtuple as that uses much less memory. We also try converting the string to ascii to further reduce the size. | ||||
* | Support authenticated SMTP | Daniel Dent | 2017-04-05 | 1 | -1/+5 |
| | | | | | | Closes (SYN-714) #1385 Signed-off-by: Daniel Dent <matrixcontrib@contactdaniel.net> | ||||
* | Merge pull request #2075 from matrix-org/erikj/cache_speed | Erik Johnston | 2017-03-31 | 1 | -5/+2 |
|\ | | | | | Speed up cached function access | ||||
| * | Don't convert to deferreds when not necessary | Erik Johnston | 2017-03-30 | 1 | -5/+2 |
| | | |||||
* | | Cache glob to regex at a higher level for push | Erik Johnston | 2017-03-29 | 1 | -47/+57 |
|/ | |||||
* | Don't recreate so many sets | Erik Johnston | 2017-03-16 | 1 | -4/+4 |
| | |||||
* | Get current state by using current_state_events table | Erik Johnston | 2017-03-10 | 1 | -1/+1 |
| | |||||
* | Ensure we pass positive ints to delay function | Erik Johnston | 2017-02-22 | 1 | -1/+2 |
| | |||||
* | Fix email push in pusher worker | Erik Johnston | 2017-02-02 | 1 | -2/+2 |
| | | | | | | This was broken when device list updates were implemented, as Mailer could no longer instantiate an AuthHandler due to a dependency on federation sending. | ||||
* | Merge pull request #1811 from aperezdc/unhardcode-riot-urls | David Baker | 2017-01-18 | 1 | -6/+14 |
|\ | | | | | Allow configuring the Riot URL used in notification emails | ||||
| * | Allow configuring the Riot URL used in notification emails | Adrian Perez de Castro | 2017-01-13 | 1 | -6/+14 |
| | | | | | | | | | | | | | | | | | | | | The URLs used for notification emails were hardcoded to use either matrix.to or vector.im; but for self-hosted setups where Riot is also self-hosted it may be desirable to allow configuring an alternative Riot URL. Fixes #1809. Signed-off-by: Adrian Perez de Castro <aperez@igalia.com> | ||||
* | | Get state at event rather than for room in push | Erik Johnston | 2017-01-17 | 1 | -1/+1 |
|/ | |||||
* | Add /room/<room_id>/joined_members API | Erik Johnston | 2016-12-08 | 1 | -6/+6 |
| | | | | | | This returns the currently joined members in the room with their display names and avatar urls. This is more efficient than /members for large rooms where you don't need the full events. | ||||
* | Fix push notifications for a single unread message | Erik Johnston | 2016-10-18 | 1 | -1/+1 |
| | |||||
* | Reduce redundant database work in email pusher | Erik Johnston | 2016-10-18 | 1 | -0/+4 |
| | | | | | | | Update the last stream ordering if the `get_unread_push_actions_for_user_in_range_for_email` returns no new push actions. This reduces the range that it needs to check next iteration. | ||||
* | Fix email push notifs being dropped | Erik Johnston | 2016-10-13 | 1 | -14/+25 |
| | | | | | | | | A lot of email push notifications were failing to be sent due to an exception being thrown along one of the (many) paths. This was due to a change where we moved from pulling out the full state for each room, but rather pulled out the event ids for the state and separately loaded the full events when needed. | ||||
* | _id field must uniquely identify different conditions | Erik Johnston | 2016-09-19 | 1 | -2/+2 |
| | |||||
* | proposal for notifying on e2e events | Matthew Hodgson | 2016-09-17 | 1 | -0/+49 |
| | |||||
* | Ensure we don't mutate the cache of push rules | Erik Johnston | 2016-09-15 | 1 | -9/+1 |
| | |||||
* | Make bulk_get_push_rules_for_room use get_joined_users_from_context cache | Erik Johnston | 2016-09-05 | 1 | -1/+1 |
| | |||||
* | Merge pull request #1060 from matrix-org/erikj/state_ids | Erik Johnston | 2016-09-01 | 1 | -1/+1 |
|\ | | | | | Assign state groups in state handler. | ||||
| * | Correctly handle the difference between prev and current state | Erik Johnston | 2016-08-31 | 1 | -1/+1 |
| | | |||||
* | | Fix email notifs by adding missing param | Erik Johnston | 2016-08-30 | 1 | -1/+1 |
|/ | |||||
* | Fix push room names for rooms with only an alias | Erik Johnston | 2016-08-30 | 1 | -1/+1 |
| | |||||
* | Use state handler instead of get_users_in_room/get_joined_hosts | Erik Johnston | 2016-08-26 | 1 | -1/+1 |
| | |||||
* | Fix room name in email notifs | Erik Johnston | 2016-08-26 | 1 | -19/+20 |
| | |||||
* | Typo | Erik Johnston | 2016-08-26 | 1 | -1/+0 |
| | |||||
* | Fix up push to use get_current_state_ids | Erik Johnston | 2016-08-25 | 4 | -20/+226 |
| | |||||
* | Replace context.current_state with context.current_state_ids | Erik Johnston | 2016-08-25 | 2 | -19/+17 |
| | |||||
* | Preserve some logcontexts | Erik Johnston | 2016-08-24 | 2 | -9/+12 |
| | |||||
* | Move _bulk_get_push_rules_for_room to storage layer | Erik Johnston | 2016-08-19 | 2 | -34/+9 |
| | |||||
* | Make push Measure finer grained | Erik Johnston | 2016-08-17 | 1 | -4/+5 |
| | |||||
* | Merge remote-tracking branch 'origin/develop' into ↵ | David Baker | 2016-08-16 | 1 | -4/+4 |
|\ | | | | | | | dbkr/contains_display_name_override | ||||
| * | Refactor user_delete_access_tokens. Invalidate get_user_by_access_token to ↵ | Erik Johnston | 2016-08-15 | 1 | -4/+4 |
| | | | | | | | | slaves. | ||||
* | | s/underride/override/ in the rule_id too | David Baker | 2016-08-16 | 1 | -1/+1 |
| | | |||||
* | | Move display name rule | David Baker | 2016-08-15 | 1 | -16/+20 |
|/ | | | | As per https://github.com/matrix-org/matrix-doc/pull/373 and comment | ||||
* | Ignore AlreadyCalled errors on timer cancel | Erik Johnston | 2016-07-31 | 2 | -3/+16 |
| | |||||
* | Create separate methods for getting messages to push | Mark Haines | 2016-07-28 | 2 | -4/+4 |
| | | | | | | | | | | | 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. | ||||
* | Typo | David Baker | 2016-07-28 | 1 | -1/+1 |
| | |||||
* | even more pep8 | David Baker | 2016-06-24 | 1 | -0/+1 |
| | |||||
* | Use similar naming we use in email notifs for push | David Baker | 2016-06-24 | 2 | -20/+22 |
| | | | | Fixes https://github.com/vector-im/vector-web/issues/1654 | ||||
* | Fix ``KeyError: 'msgtype'``. Use ``.get`` | Mark Haines | 2016-06-17 | 1 | -14/+15 |
| | | | | | | | | | | | | | Fixes a key error where the mailer tried to get the ``msgtype`` of an event that was missing a ``msgtype``. ``` File "synapse/push/mailer.py", line 264, in get_notif_vars File "synapse/push/mailer.py", line 285, in get_message_vars File ".../frozendict/__init__.py", line 10, in __getitem__ return self.__dict[key] KeyError: 'msgtype' ``` | ||||
* | Remove dead code. | Mark Haines | 2016-06-07 | 2 | -34/+0 |
| | | | | | | | | | | | Loading push rules now happens in the datastore, so we can remove the methods that loaded them outside the datastore. The ``waiting_for_join_list`` in federation handler is populated by anything, so can be removed. The ``_get_members_events_txn`` method isn't called from anywhere so can be removed. | ||||
* | 3rd time lucky: we'd already calculated it above | David Baker | 2016-06-03 | 1 | -3/+1 |
| | |||||
* | Oops, we're using the dict form | David Baker | 2016-06-03 | 1 | -1/+3 |
| | |||||
* | Add substitutions to email notif From | David Baker | 2016-06-03 | 1 | -1/+1 |
| | |||||
* | Merge branch 'develop' into matthew/brand-from-header | Matthew Hodgson | 2016-06-03 | 5 | -61/+67 |
|\ | |||||
| * | Load push rules in storage layer, so that they get cached | Erik Johnston | 2016-06-03 | 2 | -36/+22 |
| | | |||||
| * | Remove unnecessary sets | Erik Johnston | 2016-06-03 | 1 | -6/+3 |
| | | |||||
| * | Only get local users | Erik Johnston | 2016-06-03 | 1 | -2/+5 |
| | | |||||
| * | Merge pull request #811 from matrix-org/erikj/state_users_in_room | Erik Johnston | 2016-06-03 | 2 | -11/+18 |
| |\ | | | | | | | Use state to calculate get_users_in_room | ||||
| | * | Use state to calculate get_users_in_room | Erik Johnston | 2016-06-01 | 2 | -11/+18 |
| | | | |||||
| * | | Merge pull request #809 from matrix-org/erikj/cache_receipts_in_room | Erik Johnston | 2016-06-03 | 1 | -4/+4 |
| |\| | | | | | | | Add get_users_with_read_receipts_in_room cache | ||||
| | * | Add get_users_with_read_receipts_in_room cache | Erik Johnston | 2016-06-01 | 1 | -4/+4 |
| | | | |||||
| * | | Merge pull request #821 from matrix-org/dbkr/email_unsubscribe | David Baker | 2016-06-02 | 2 | -6/+19 |
| |\ \ | | | | | | | | | Email unsubscribe links that don't require logging in | ||||
| | * | | peppate | David Baker | 2016-06-02 | 1 | -1/+3 |
| | | | | |||||
| | * | | Working unsubscribe links going straight to the HS | David Baker | 2016-06-02 | 1 | -4/+4 |
| | | | | | | | | | | | | | | | | and authed by macaroons that let you delete pushers and nothing else | ||||
| | * | | Merge remote-tracking branch 'origin/dbkr/email_notif_string_fmt_error' into ↵ | David Baker | 2016-06-02 | 1 | -1/+1 |
| | |\ \ | | | | | | | | | | | | | | | | dbkr/email_unsubscribe | ||||
| | * \ \ | Merge remote-tracking branch 'origin/develop' into dbkr/email_unsubscribe | David Baker | 2016-06-02 | 2 | -4/+10 |
| | |\ \ \ | |||||
| | * \ \ \ | Merge branch 'dbkr/split_out_auth_handler' into dbkr/email_unsubscribe | David Baker | 2016-06-02 | 1 | -0/+2 |
| | |\ \ \ \ | |||||
| | * | | | | | Email unsubscribing that may in theory, work | David Baker | 2016-06-02 | 2 | -6/+17 |
| | | |_|_|/ | | |/| | | | | | | | | | | | | | | | Were it not for that fact that you can't use the base handler in the pusher because it pulls in the world. Comitting while I fix that on a different branch. |