summary refs log tree commit diff
path: root/synapse/storage/databases/main/roommember.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Improve event caching code (#10119)Erik Johnston2021-08-041-4/+2
| | | | Ensure we only load an event from the DB once when the same event is requested multiple times at once.
* [pyupgrade] `synapse/` (#10348)Jonathan de Jong2021-07-191-1/+1
| | | | | | | | | This PR is tantamount to running ``` pyupgrade --py36-plus --keep-percent-format `find synapse/ -type f -name "*.py"` ``` Part of #9744
* Show all joinable rooms in the spaces summary. (#10298)Patrick Cloke2021-07-131-2/+11
| | | | | | | | | | Previously only world-readable rooms were shown. This means that rooms which are public, knockable, or invite-only with a pending invitation, are included in a space summary. It also applies the same logic to the experimental room version from MSC3083 -- if a user has access to the proper allowed rooms then it is shown in the spaces summary. This change is made per MSC3173 allowing stripped state of a room to be shown to any potential room joiner.
* Fix incorrect time magnitude on delayed call (#10195)Andrew Morgan2021-06-171-1/+1
| | | | | | | | | Fixes https://github.com/matrix-org/synapse/issues/10030. We were expecting milliseconds where we should have provided a value in seconds. The impact of this bug isn't too bad. The code is intended to count the number of remote servers that the homeserver can see and report that as a metric. This metric is supposed to run initially 1 second after server startup, and every 60s as well. Instead, it ran 1,000 seconds after server startup, and every 60s after startup. This fix allows for the correct metrics to be collected immediately, as well as preventing a random collection 1,000s in the future after startup.
* Use get_current_users_in_room from store and not StateHandler (#9910)Erik Johnston2021-05-051-2/+6
|
* Only store data in caches, not "smart" objects (#9845)Erik Johnston2021-04-231-72/+89
|
* Remove `synapse.types.Collection` (#9856)Richard van der Hoff2021-04-221-2/+12
| | | This is no longer required, since we have dropped support for Python 3.5.
* User directory: use calculated room membership state instead (#9821)Andrew Morgan2021-04-161-0/+27
| | | | | Fixes: #9797. Should help reduce CPU usage on the user directory, especially when memberships change in rooms with lots of state history.
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-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>`
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-8/+9
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Use execute_batch in more places (#9188)Erik Johnston2021-01-211-5/+1
| | | | | * Use execute_batch in more places * Newsfile
* Speed up remote invite rejection database call (#8815)Andrew Morgan2020-11-251-1/+33
| | | | | | | | | | | | | This is another PR that grew out of #6739. The existing code for checking whether a user is currently invited to a room when they want to leave the room looks like the following: https://github.com/matrix-org/synapse/blob/f737368a26bb9eea401fcc3a5bdd7e0b59e91f09/synapse/handlers/room_member.py#L518-L540 It calls `get_invite_for_local_user_in_room`, which will actually query *all* rooms the user has been invited to, before iterating over them and matching via the room ID. It will then return a tuple of a lot of information which we pull the event ID out of. I need to do a similar check for knocking, but this code wasn't very efficient. I then tried to write a different implementation using `StateHandler.get_current_state` but this actually didn't work as we haven't *joined* the room yet - we've only been invited to it. That means that only certain tables in Synapse have our desired `invite` membership state. One of those tables is `local_current_membership`. So I wrote a store method that just queries that table instead
* Consistently use wrap_as_background_task in more places (#8599)Patrick Cloke2020-10-201-9/+7
|
* Add `DeferredCache.get_immediate` method (#8568)Richard van der Hoff2020-10-191-1/+1
| | | | | | | | | | | * Add `DeferredCache.get_immediate` method A bunch of things that are currently calling `DeferredCache.get` are only really interested in the result if it's completed. We can optimise and simplify this case. * Remove unused 'default' parameter to DeferredCache.get() * another get_immediate instance
* Move additional tasks to the background worker (#8458)Patrick Cloke2020-10-071-1/+4
|
* Add logging on startup/shutdown (#8448)Erik Johnston2020-10-021-10/+3
| | | | | This is so we can tell what is going on when things are taking a while to start up. The main change here is to ensure that transactions that are created during startup get correctly logged like normal transactions.
* Add EventStreamPosition type (#8388)Erik Johnston2020-09-241-5/+9
| | | | | | | | | | | | | | The idea is to remove some of the places we pass around `int`, where it can represent one of two things: 1. the position of an event in the stream; or 2. a token that partitions the stream, used as part of the stream tokens. The valid operations are then: 1. did a position happen before or after a token; 2. get all events that happened before or after a token; and 3. get all events between two tokens. (Note that we don't want to allow other operations as we want to change the tokens to be vector clocks rather than simple ints)
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-3/+3
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* Fix typing for SyncHandler (#8237)Erik Johnston2020-09-031-3/+3
|
* Convert `event_push_actions`, `registration`, and `roommember` datastores to ↵Patrick Cloke2020-08-281-25/+27
| | | | async (#8197)
* Convert some of the general database methods to async (#8100)Patrick Cloke2020-08-171-2/+2
|
* Convert misc database code to async (#8087)Patrick Cloke2020-08-141-11/+6
|
* Convert the roommember database to async/await. (#8070)Patrick Cloke2020-08-121-165/+98
|
* Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-0/+1139