Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix 404 on `/sync` when the last event is a redaction of an unknown/purged ↵ | Richard van der Hoff | 2022-06-01 | 1 | -10/+18 |
| | | | | | | | | | | | event (#12905) Currently, we try to pull the event corresponding to a sync token from the database. However, when we fetch redaction events, we check the target of that redaction (because we aren't allowed to send redactions to clients without validating them). So, if the sync token points to a redaction of an event that we don't have, we have a problem. It turns out we don't really need that event, and can just work with its ID and metadata, which sidesteps the whole problem. | ||||
* | Rename storage classes (#12913) | Erik Johnston | 2022-05-31 | 1 | -5/+5 |
| | |||||
* | Prevent expired events from being filtered out when retention is disabled ↵ | Brendan Abolivier | 2022-05-23 | 1 | -3/+3 |
| | | | | | | (#12611) Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> | ||||
* | Optimise backfill calculation (#12522) | Richard van der Hoff | 2022-04-26 | 1 | -0/+7 |
| | | | | | | Try to avoid an OOM by checking fewer extremities. Generally this is a big rewrite of _maybe_backfill, to try and fix some of the TODOs and other problems in it. It's best reviewed commit-by-commit. | ||||
* | Handle outliers in `/federation/v1/event` (#12332) | Richard van der Hoff | 2022-03-31 | 1 | -106/+128 |
| | | | | | | | The intention here is to avoid doing state lookups for outliers in `/_matrix/federation/v1/event`. Unfortunately that's expanded into something of a rewrite of `filter_events_for_server`, which ended up trying to do that operation in a couple of places. | ||||
* | Use the ignored_users table to test event visibility & sync. (#12225) | Patrick Cloke | 2022-03-15 | 1 | -15/+3 |
| | | | | | Instead of fetching the raw account data and re-parsing it. The ignored_users table is a denormalised version of the account data for quick searching. | ||||
* | Update client-visibility filtering for outlier events (#12155) | Richard van der Hoff | 2022-03-04 | 1 | -1/+16 |
| | | | Avoid trying to get the state for outliers, which isn't a sensible thing to do. | ||||
* | Make the `get_global_account_data_by_type_for_user` cache be a tree-cache ↵ | reivilibre | 2022-01-21 | 1 | -1/+1 |
| | | | | whose key is prefixed with the user ID (#11788) | ||||
* | [pyupgrade] `synapse/` (#10348) | Jonathan de Jong | 2021-07-19 | 1 | -2/+2 |
| | | | | | | | | | This PR is tantamount to running ``` pyupgrade --py36-plus --keep-percent-format `find synapse/ -type f -name "*.py"` ``` Part of #9744 | ||||
* | Use inline type hints in various other places (in `synapse/`) (#10380) | Jonathan de Jong | 2021-07-15 | 1 | -1/+1 |
| | |||||
* | Remove redundant "coding: utf-8" lines (#9786) | Jonathan de Jong | 2021-04-14 | 1 | -1/+0 |
| | | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>` | ||||
* | Add type hints to misc. files. (#9676) | Patrick Cloke | 2021-03-24 | 1 | -40/+38 |
| | |||||
* | Merge pull request #9150 from Yoric/develop-context | David Teller | 2021-02-08 | 1 | -0/+1 |
|\ | | | | | New API /_synapse/admin/rooms/{roomId}/context/{eventId} | ||||
| * | FIXUP: Don't filter events at all for admin/v1/rooms/.../context/... | David Teller | 2021-01-28 | 1 | -19/+6 |
| | | |||||
| * | New API /_synapse/admin/rooms/{roomId}/context/{eventId} | David Teller | 2021-01-28 | 1 | -6/+20 |
| | | | | | | | | Signed-off-by: David Teller <davidt@element.io> | ||||
* | | Typo fix in a comment: subequently -> subsequently. (#8988) | Tim Gates | 2021-02-03 | 1 | -1/+1 |
|/ | |||||
* | Try and drop stale extremities. (#8929) | Erik Johnston | 2020-12-18 | 1 | -1/+1 |
| | | | | If we see stale extremities while persisting events, and notice that they don't change the result of state resolution, we drop them. | ||||
* | Do not assume that the contents dictionary includes history_visibility. (#8945) | Patrick Cloke | 2020-12-16 | 1 | -14/+28 |
| | |||||
* | Do not assume that account data is of the correct form. (#8454) | Patrick Cloke | 2020-10-05 | 1 | -8/+7 |
| | | | | This fixes a bug where `m.ignored_user_list` was assumed to be a dict, leading to odd behavior for users who set it to something else. | ||||
* | Convert groups and visibility code to async / await. (#7951) | Patrick Cloke | 2020-07-27 | 1 | -17/+13 |
| | |||||
* | Fix some spelling mistakes / typos. (#7811) | Patrick Cloke | 2020-07-09 | 1 | -2/+2 |
| | |||||
* | Replace all remaining six usage with native Python 3 equivalents (#7704) | Dagfinn Ilmari Mannsåker | 2020-06-16 | 1 | -2/+0 |
| | |||||
* | Replace iteritems/itervalues/iterkeys with native versions. (#7692) | Patrick Cloke | 2020-06-15 | 1 | -13/+8 |
| | |||||
* | Refactor a bit | Brendan Abolivier | 2020-03-11 | 1 | -28/+30 |
| | |||||
* | Also don't fail on aliases events in this case | Brendan Abolivier | 2020-03-11 | 1 | -1/+1 |
| | |||||
* | Lint | Brendan Abolivier | 2020-03-11 | 1 | -1/+5 |
| | |||||
* | Also don't filter out events sent by ignored users when checking state ↵ | Brendan Abolivier | 2020-03-11 | 1 | -1/+1 |
| | | | | visibility | ||||
* | Fix condition | Brendan Abolivier | 2020-03-11 | 1 | -1/+1 |
| | |||||
* | Don't filter out dummy events when we're checking the visibility of state | Brendan Abolivier | 2020-03-11 | 1 | -8/+7 |
| | |||||
* | Hide extremities dummy events from clients | Brendan Abolivier | 2020-03-04 | 1 | -0/+3 |
| | |||||
* | Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957) | Patrick Cloke | 2020-02-21 | 1 | -2/+2 |
| | | | | Ensure good comprehension hygiene using flake8-comprehensions. | ||||
* | filter out m.room.aliases from the CS API until a better solution is specced ↵ | Matthew Hodgson | 2020-02-10 | 1 | -0/+7 |
| | | | | | (#6878) We're in the middle of properly mitigating spam caused by malicious aliases being added to a room. However, until this work fully lands, we temporarily filter out all m.room.aliases events from /sync and /messages on the CS API, to remove abusive aliases. This is considered acceptable as m.room.aliases events were never a reliable record of the given alias->id mapping and were purely informational, and in their current state do more harm than good. | ||||
* | Update the documentation of the filtering function | Brendan Abolivier | 2019-12-16 | 1 | -1/+2 |
| | |||||
* | Lint | Brendan Abolivier | 2019-11-28 | 1 | -4/+8 |
| | |||||
* | Discard retention policies when retrieving state | Brendan Abolivier | 2019-11-28 | 1 | -8/+14 |
| | | | | | | | | Purge jobs don't delete the latest event in a room in order to keep the forward extremity and not break the room. On the other hand, get_state_events, when given an at_token argument calls filter_events_for_client to know if the user can see the event that matches that (sync) token. That function uses the retention policies of the events it's given to filter out those that are too old from a client's view. Some clients, such as Riot, when loading a room, request the list of members for the latest sync token it knows about, and get confused to the point of refusing to send any message if the server tells it that it can't get that information. This can happen very easily with the message retention feature turned on and a room with low activity so that the last event sent becomes too old according to the room's retention policy. An easy and clean fix for that issue is to discard the room's retention policies when retrieving state. | ||||
* | Don't apply retention policy based filtering on state events | Brendan Abolivier | 2019-11-06 | 1 | -6/+9 |
| | | | | As per MSC1763, 'Retention is only considered for non-state events.', so don't filter out state events based on the room's retention policy. | ||||
* | Implement per-room message retention policies | Brendan Abolivier | 2019-11-04 | 1 | -0/+17 |
| | |||||
* | Port to use state storage | Erik Johnston | 2019-10-30 | 1 | -13/+17 |
| | |||||
* | Replace returnValue with return (#5736) | Amber Brown | 2019-07-23 | 1 | -4/+4 |
| | |||||
* | Run Black. (#5482) | Amber Brown | 2019-06-20 | 1 | -41/+28 |
| | |||||
* | Implement soft fail | Erik Johnston | 2019-03-06 | 1 | -0/+4 |
| | |||||
* | clarify comments | Erik Johnston | 2019-03-05 | 1 | -1/+1 |
| | |||||
* | Fix missing null guard | Erik Johnston | 2019-03-04 | 1 | -1/+1 |
| | |||||
* | Only check history visibility when filtering | Erik Johnston | 2019-03-04 | 1 | -34/+43 |
| | | | | | | When filtering events to send to server we check more than just history visibility. However when deciding whether to backfill or not we only care about the history visibility. | ||||
* | Stop backpaginating when events not visible | Erik Johnston | 2019-02-20 | 1 | -5/+25 |
| | |||||
* | Refactor state group lookup to reduce DB hits (#4011) | Erik Johnston | 2018-10-25 | 1 | -6/+9 |
| | | | | | | | | Currently when fetching state groups from the data store we make two hits two the database: once for members and once for non-members (unless request is filtered to one or the other). This adds needless load to the datbase, so this PR refactors the lookup to make only a single database hit. | ||||
* | synapse/visibility.py: fix SyntaxError on py3.7 | Ivan Shapovalov | 2018-10-14 | 1 | -1/+1 |
| | |||||
* | Optimisation for filter_events_for_server | Richard van der Hoff | 2018-10-08 | 1 | -7/+6 |
| | | | | | | | We're better off hashing just the event_id than the whole ((type, state_key), event_id) tuple - so use a dict instead of a set. Also, iteritems > items. | ||||
* | Merge remote-tracking branch 'origin/develop' into rav/remove_who_forgot_in_room | Richard van der Hoff | 2018-07-23 | 1 | -9/+10 |
|\ | |||||
| * | Make the rest of the .iterwhatever go away (#3562) | Amber Brown | 2018-07-21 | 1 | -9/+10 |
| | | |||||
* | | Remove redundant checks on room forgottenness | Richard van der Hoff | 2018-07-23 | 1 | -18/+1 |
|/ | | | | Fixes #3550 | ||||
* | add a comment | Richard van der Hoff | 2018-07-17 | 1 | -0/+2 |
| | |||||
* | Fix visibility of events from erased users over federation | Richard van der Hoff | 2018-07-17 | 1 | -56/+67 |
| | |||||
* | fix imports | Richard van der Hoff | 2018-07-17 | 1 | -0/+1 |
| | |||||
* | add a comment | Richard van der Hoff | 2018-07-17 | 1 | -0/+2 |
| | |||||
* | Attempt to make _filter_events_for_server more efficient | Richard van der Hoff | 2018-07-16 | 1 | -17/+23 |
| | |||||
* | Move filter_events_for_server out of FederationHandler | Richard van der Hoff | 2018-07-16 | 1 | -0/+132 |
| | | | | for easier unit testing. | ||||
* | run isort | Amber Brown | 2018-07-09 | 1 | -3/+1 |
| | |||||
* | Revert "Revert "Merge pull request #3431 from ↵ | Erik Johnston | 2018-06-25 | 1 | -22/+55 |
| | | | | | | matrix-org/rav/erasure_visibility"" This reverts commit 1d009013b3c3e814177afc59f066e02a202b21cd. | ||||
* | Revert "Merge pull request #3431 from matrix-org/rav/erasure_visibility" | Richard van der Hoff | 2018-06-22 | 1 | -55/+22 |
| | | | | | This reverts commit ce0d911156b355c5bf452120bfb08653dad96497, reversing changes made to b4a5d767a94f1680d07edfd583aae54ce422573e. | ||||
* | Filter out erased messages | Richard van der Hoff | 2018-06-12 | 1 | -22/+55 |
| | | | | Redact any messges sent by erased users. | ||||
* | remove dead filter_events_for_clients | Richard van der Hoff | 2018-06-12 | 1 | -64/+34 |
| | | | | | | This is only used by filter_events_for_client, so we can simplify the whole thing by just doing one user at a time, and removing a dead storage function to boot. | ||||
* | Remove preserve_context_over_{fn, deferred} | Richard van der Hoff | 2017-11-14 | 1 | -2/+2 |
| | | | | | Both of these functions ae known to leak logcontexts. Replace the remaining calls to them and kill them off. | ||||
* | Don't filter out current state events from timeline | Erik Johnston | 2017-09-18 | 1 | -3/+11 |
| | |||||
* | Perf: Don't filter events for push | Erik Johnston | 2017-07-07 | 1 | -19/+0 |
| | | | | | We know the users are joined and we can explicitly check for if they are ignoring the user, so lets do that. | ||||
* | Revert "Speed up filtering of a single event in push" | Erik Johnston | 2017-05-08 | 1 | -0/+19 |
| | | | | This reverts commit 421fdf74609439edaaffce117436e6a6df147841. | ||||
* | Speed up filtering of a single event in push | Erik Johnston | 2017-04-28 | 1 | -19/+0 |
| | |||||
* | Don't convert to deferreds when not necessary | Erik Johnston | 2017-03-30 | 1 | -1/+2 |
| | |||||
* | Fix rejection of invites not reaching sync | David Baker | 2017-03-23 | 1 | -0/+7 |
| | | | | | | | Always allow the user to see their own leave events, otherwise they won't see the event if they reject an invite for a room whose history visibility is set such that they cannot see events before joining. | ||||
* | Replace context.current_state with context.current_state_ids | Erik Johnston | 2016-08-25 | 1 | -0/+19 |
| | |||||
* | Preserve some logcontexts | Erik Johnston | 2016-08-24 | 1 | -3/+3 |
| | |||||
* | move filter_events_for_client out of base handler | Mark Haines | 2016-05-11 | 1 | -0/+210 |