summary refs log tree commit diff
path: root/tests/rest/admin/test_room.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+1
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Update license headersPatrick Cloke2023-11-211-10/+16
|
* Ensure local invited & knocking users leave before purge. (#16559)Patrick Cloke2023-10-271-1/+52
| | | | | This is mostly useful for federated rooms where some users would get stuck in the invite or knock state when the room was purged from their homeserver.
* Add automatic purge after all users forget a room (#15488)Mathieu Velten2023-09-151-15/+144
| | | | | | Also add restore of purge/shutdown rooms after a synapse restart. Co-authored-by: Eric Eastwood <erice@matrix.org> Co-authored-by: Erik Johnston <erikj@matrix.org>
* Fix error when sending message into deleted room. (#15235)Erik Johnston2023-03-211-0/+15
| | | | | | | | When a room is deleted in Synapse we remove the event forward extremities in the room, so if (say a bot) tries to send a message into the room we error out due to not being able to calculate prev events for the new event *before* we check if the sender is in the room. Fixes #8094
* Bump black from 22.12.0 to 23.1.0 (#15103)dependabot[bot]2023-02-221-1/+0
|
* Faster joins: omit partial rooms from eager syncs until the resync completes ↵David Robertson2023-01-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#14870) * Allow `AbstractSet` in `StrCollection` Or else frozensets are excluded. This will be useful in an upcoming commit where I plan to change a function that accepts `List[str]` to accept `StrCollection` instead. * `rooms_to_exclude` -> `rooms_to_exclude_globally` I am about to make use of this exclusion mechanism to exclude rooms for a specific user and a specific sync. This rename helps to clarify the distinction between the global config and the rooms to exclude for a specific sync. * Better function names for internal sync methods * Track a list of excluded rooms on SyncResultBuilder I plan to feed a list of partially stated rooms for this sync to ignore * Exclude partial state rooms during eager sync using the mechanism established in the previous commit * Track un-partial-state stream in sync tokens So that we can work out which rooms have become fully-stated during a given sync period. * Fix mutation of `@cached` return value This was fouling up a complement test added alongside this PR. Excluding a room would mean the set of forgotten rooms in the cache would be extended. This means that room could be erroneously considered forgotten in the future. Introduced in #12310, Synapse 1.57.0. I don't think this had any user-visible side effects (until now). * SyncResultBuilder: track rooms to force as newly joined Similar plan as before. We've omitted rooms from certain sync responses; now we establish the mechanism to reintroduce them into future syncs. * Read new field, to present rooms as newly joined * Force un-partial-stated rooms to be newly-joined for eager incremental syncs only, provided they're still fully stated * Notify user stream listeners to wake up long polling syncs * Changelog * Typo fix Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com> * Unnecessary list cast Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com> * Rephrase comment Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com> * Another comment Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com> * Fixup merge(?) * Poke notifier when receiving un-partial-stated msg over replication * Fixup merge whoops Thanks MV :) Co-authored-by: Mathieu Velen <mathieuv@matrix.org> Co-authored-by: Mathieu Velten <mathieuv@matrix.org> Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
* Implement message forward pagination from start when no from is given, fixes ↵Benjamin Kampmann2022-11-241-0/+40
| | | | | #12383 (#14149) Fixes https://github.com/matrix-org/synapse/issues/12383
* Add Admin API to Fetch Messages Within a Particular Window (#13672)Connor Davis2022-09-071-1/+157
| | | This adds two new admin APIs that allow us to fetch messages from a room within a particular time.
* Fix admin List Room API return type on sqlite (#13509)David Robertson2022-08-311-5/+14
|
* Add forgotten status to Room Details API (#13503)Dirk Klimpel2022-08-171-0/+1
|
* Use literals in place of `HTTPStatus` constants in tests (#13488)Dirk Klimpel2022-08-101-26/+23
| | | | | | | | | * Use literals in place of `HTTPStatus` constants in tests * newsfile * code style * code style
* Use literals in place of `HTTPStatus` constants in tests (#13479)Dirk Klimpel2022-08-091-20/+20
| | | | | | | | | | Replace - `HTTPStatus.NOT_FOUND` - `HTTPStatus.FORBIDDEN` - `HTTPStatus.UNAUTHORIZED` - `HTTPStatus.CONFLICT` - `HTTPStatus.CREATED` Signed-off-by: Dirk Klimpel <dirk@klimpel.org>
* Use literals in place of `HTTPStatus` constants in tests (#13469)Dirk Klimpel2022-08-081-63/+61
|
* Return 404 or member list when getting joined_members after leaving (#13374)andrew do2022-08-031-0/+15
| | | | | | Signed-off-by: Andrew Doh <andrewddo@gmail.com> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Andrew Morgan <andrewm@element.io> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Make minor clarifications to the error messages given when we fail to join a ↵reivilibre2022-07-271-1/+4
| | | | room via any server. (#13160)
* expose whether a room is a space in the Admin API (#13208)andrew do2022-07-121-3/+10
|
* annotate tests.server.FakeChannel (#13136)David Robertson2022-07-041-2/+2
|
* Remove remaining pieces of groups code. (#12966)Patrick Cloke2022-06-061-2/+0
| | | | | * Remove an unused stream ID generator. * Remove the now unused remote profile cache.
* Delete events from federation_inbound_events_staging table on purge (#12770)Mathieu Velten2022-05-171-0/+1
|
* Replace assertEquals and friends with non-deprecated versions. (#12092)Patrick Cloke2022-02-281-7/+7
|
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-231-3/+3
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Drop unused table `public_room_list_stream`. (#11795)Richard van der Hoff2022-01-211-1/+0
| | | This is a follow-up to #10565.
* Make pagination of rooms in admin api stable (#11737)Daniel Sonck2022-01-171-19/+28
| | | | | | | | | | | | | | Always add state.room_id after the configurable ORDER BY. Otherwise, for any sort, certain pages can contain results from other pages. (Especially when sorting by creator, since there may be many rooms by the same creator) * Document different order direction of numerical fields "joined_members", "joined_local_members", "version" and "state_events" are ordered in descending direction by default (dir=f). Added a note in tests to explain the differences in ordering. Signed-off-by: Daniël Sonck <daniel@sonck.nl>
* Add type hints to `synapse/tests/rest/admin` (#11590)Dirk Klimpel2021-12-161-31/+31
|
* Fix 'delete room' admin api to work on incomplete rooms (#11523)Richard van der Hoff2021-12-071-17/+25
| | | | | If, for some reason, we don't have the create event, we should still be able to purge a room.
* Add type hints to `synapse/tests/rest/admin` (#11501)Dirk Klimpel2021-12-031-45/+50
|
* Remove unnecessary `json.dumps` from `tests.rest.admin` (#11461)Dirk Klimpel2021-11-301-41/+20
| | | | | The tests helpers automatically convert dictionaries to JSON payloads, no need to do it manually for each test.
* Convert status codes to `HTTPStatus` in `tests.rest.admin` (#11455)Dirk Klimpel2021-11-301-71/+75
|
* Add dedicated admin API for blocking a room (#11324)Dirk Klimpel2021-11-181-0/+228
|
* Convert delete room admin API to async endpoint (#11223)Dirk Klimpel2021-11-121-65/+661
| | | Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Allow admins to proactively block rooms (#11228)David Robertson2021-11-091-0/+28
| | | | Co-authored-by: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Add search by room ID and room alias to List Room admin API (#11099)Dirk Klimpel2021-11-021-39/+49
| | | | Fixes: #10874 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Fix a bug in unit test `test_block_room_and_not_purge` (#11226)Dirk Klimpel2021-11-011-2/+2
|
* Remove deprecated delete room admin API (#11213)Dirk Klimpel2021-11-011-24/+15
| | | | | Remove deprecated delete room admin API, `POST /_synapse/admin/v1/rooms/<room_id>/delete`
* Use direct references for some configuration variables (part 3) (#10885)Patrick Cloke2021-09-231-1/+1
| | | | | | | | This avoids the overhead of searching through the various configuration classes by directly referencing the class that the attributes are in. It also improves type hints since mypy can now resolve the types of the configuration variables.
* Allow Synapse Admin API's Room Search to accept non-ASCII characters (#10859)Hillery Shay2021-09-211-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add tests for checking if room search works with non-ascii char * change encoding on parse_string to UTF-8 * lints * properly encode search term * lints * add changelog file * update changelog number * set changelog entry filetype to .bugfix * Revert "set changelog entry filetype to .bugfix" This reverts commit be8e5a314251438ec4ec7dbc59ba32162c93e550. * update changelog message and file type * change parse_string default encoding back to ascii and update room search admin api calll to parse string * refactor tests * Update tests/rest/admin/test_room.py Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Remove deprecated Shutdown Room and Purge Room Admin API (#8830)Dirk Klimpel2021-08-171-162/+0
|
* Flatten the synapse.rest.client package (#10600)reivilibre2021-08-171-1/+1
|
* [pyupgrade] `tests/` (#10347)Jonathan de Jong2021-07-131-10/+10
|
* Remove functionality associated with unused historical stats tables (#9721)Cristina2021-07-081-1/+0
| | | Fixes #9602
* Delete room endpoint (#9889)ThibF2021-04-291-19/+26
| | | | | | Support the delete of a room through DELETE request and mark previous request as deprecated through documentation. Signed-off-by: Thibault Ferrante <thibault.ferrante@pm.me>
* Fix (final) Bugbear violations (#9838)Jonathan de Jong2021-04-201-4/+4
|
* 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>`
* Use mock from the stdlib. (#9772)Patrick Cloke2021-04-091-2/+1
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-57/+121
| | | | | | | - 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
* Merge pull request #9150 from Yoric/develop-contextDavid Teller2021-02-081-0/+84
|\ | | | | New API /_synapse/admin/rooms/{roomId}/context/{eventId}
| * FIXUP: linterDavid Teller2021-01-281-1/+3
| |
| * FIXUP: Now testing that the user is admin!David Teller2021-01-281-1/+35
| |
| * New API /_synapse/admin/rooms/{roomId}/context/{eventId}David Teller2021-01-281-0/+48
| | | | | | | | Signed-off-by: David Teller <davidt@element.io>
* | Add an admin API to get the current room state (#9168)Travis Ralston2021-02-021-0/+15
|/ | | | | This could arguably replace the existing admin API for `/members`, however that is out of scope of this change. This sort of endpoint is ideal for moderation use cases as well as other applications, such as needing to retrieve various bits of information about a room to perform a task (like syncing power levels between two places). This endpoint exposes nothing more than an admin would be able to access with a `select *` query on their database.
* Removes unnecessary declarations in the tests for the admin API. (#9063)Dirk Klimpel2021-01-111-2/+0
|
* Drop the unused local_invites table. (#8979)Patrick Cloke2020-12-291-1/+0
| | | This table has been unused since Synapse v1.17.0.
* Allow server admin to get admin bit in rooms where local user is an admin ↵Erik Johnston2020-12-181-0/+138
| | | | | | | (#8756) This adds an admin API that allows a server admin to get power in a room if a local user has power in a room. Will also invite the user if they're not in the room and its a private room. Can specify another user (rather than the admin user) to be granted power. Co-authored-by: Matthew Hodgson <matthew@matrix.org>
* Make search statement in List Room and User Admin API case-insensitive (#8931)Dirk Klimpel2020-12-171-0/+7
|
* Remove spurious "SynapseRequest" result from `make_request"Richard van der Hoff2020-12-151-49/+49
| | | | This was never used, so let's get rid of it.
* Add number of local devices to Room Details Admin API (#8886)Dirk Klimpel2020-12-111-0/+34
|
* Remove deprecated `/_matrix/client/*/admin` endpoints (#8785)Dirk Klimpel2020-11-251-2/+2
| | | These are now only available via `/_synapse/admin/v1`.
* Remove redundant `HomeserverTestCase.render`Richard van der Hoff2020-11-161-46/+0
|
* Consolidate purge table lists to prevent desyncronisation (#8713)Andrew Morgan2020-11-041-67/+38
| | | I idly noticed that these lists were out of sync with each other, causing us to miss a table in a test case (`local_invites`). Let's consolidate this list instead to prevent this from happening in the future.
* Add the topic and avatar to the room details admin API (#8305)Tulir Asokan2020-09-141-0/+2
|
* Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-2/+2
|
* Add an option to disable purge in delete room admin API (#7964)Dirk Klimpel2020-07-281-2/+55
| | | | | | Add option ```purge``` to ```POST /_synapse/admin/v1/rooms/<room_id>/delete``` Fixes: #3761 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Convert tests/rest/admin/test_room.py to unix file endings (#7953)Andrew Morgan2020-07-271-1447/+1447
| | | | | Converts tests/rest/admin/test_room.py to have unix file endings after they were accidentally changed in #7613. Keeping the same changelog as #7613 as it hasn't gone out in a release yet.
* Add admin endpoint to get members in a room. (#7842)Michael Albert2020-07-161-0/+46
|
* Add delete room admin endpoint (#7613)Dirk Klimpel2020-07-141-0/+395
| | | | | | | | | | | | | | | | | | The Delete Room admin API allows server admins to remove rooms from server and block these rooms. `DELETE /_synapse/admin/v1/rooms/<room_id>` It is a combination and improvement of "[Shutdown room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/shutdown_room.md)" and "[Purge room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/purge_room.md)" API. Fixes: #6425 It also fixes a bug in [synapse/storage/data_stores/main/room.py](synapse/storage/data_stores/main/room.py) in ` get_room_with_stats`. It should return `None` if the room is unknown. But it returns an `IndexError`. https://github.com/matrix-org/synapse/blob/901b1fa561e3cc661d78aa96d59802cf2078cb0d/synapse/storage/data_stores/main/room.py#L99-L105 Related to: - #5575 - https://github.com/Awesome-Technologies/synapse-admin/issues/17 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Stop populating unused table `local_invites`. (#7793)Richard van der Hoff2020-07-071-1/+0
| | | | | This table is no longer used, so we may as well stop populating it. Removing it would prevent people rolling back to older releases of Synapse, so that can happen in a future release.
* Add room details admin endpoint (#7317)Manuel Stahl2020-05-071-0/+41
|
* Extend room admin api with additional attributes (#7225)Dirk Klimpel2020-04-221-1/+679
|
* Admin API to join users to a room. (#7051)Dirk Klimpel2020-03-271-0/+288