aboutsummaryrefslogtreecommitdiff
path: root/clientapi
AgeCommit message (Collapse)Author
2024-08-16Implement MSC3916 (#3397)Till
Needs https://github.com/matrix-org/gomatrixserverlib/pull/437
2024-08-03Fixing Presence Conflicts (#3320)jjj333_p
This is meant to cache client presence for a moment so that it doesn't oscillate. Currently Dendrite just federates out whatever presence it gets from the sync loop, which means if theres any clients attempting to sync without setting the user online, and there is an online client, it will just flip back and forth each time one of the clients polls /sync. This pull request essentially stores in a map when the client last set online ideally to allow the online client to sync again and set an online presence before setting idle or offline. I am not great at programming nor am I familiar with this codebase so if this pr is just shitwater feel free to discard, just trying to fix an issue that severely bothers me. If it is easier you can also steal the code and write it in yourself. I ran the linter, not sure that it did anything, the vscode go extension seems to format and lint anyways. I tried to run unit tests but I have no idea any of this thing. it errors on `TestRequestPool_updatePresence/same_presence_is_not_published_dummy2 (10m0s)` which I think making this change broke. I am unsure how to comply, if y'all point me in the right direction ill try to fix it. I have tested it with all the situations I can think of on my personal instance pain.agency, and this seems to stand up under all the previously bugged situations. ~~My go also decided to update a bunch of the dependencies, I hate git and github and have no idea how to fix that, it was not intentional.~~ i just overwrote them with the ones from the main repo and committed it, seems to have done what was needed. ### Pull Request Checklist <!-- Please read https://matrix-org.github.io/dendrite/development/contributing before submitting your pull request --> * [x] I have added Go unit tests or [Complement integration tests](https://github.com/matrix-org/complement) for this PR _or_ I have justified why this PR doesn't need tests * [x] Pull request includes a [sign off below using a legally identifiable name](https://matrix-org.github.io/dendrite/development/contributing#sign-off) _or_ I have already signed off privately Signed-off-by: `Joseph Winkie <jjj333.p.1325@gmail.com>` --------- Co-authored-by: Till Faelligen <2353100+S7evinK@users.noreply.github.com>
2024-08-03fix: close resp body (#3364)guoguangwu
### Pull Request Checklist <!-- Please read https://matrix-org.github.io/dendrite/development/contributing before submitting your pull request --> * [ ] I have added Go unit tests or [Complement integration tests](https://github.com/matrix-org/complement) for this PR _or_ I have justified why this PR doesn't need tests * [ ] Pull request includes a [sign off below using a legally identifiable name](https://matrix-org.github.io/dendrite/development/contributing#sign-off) _or_ I have already signed off privately Signed-off-by: `Your Name <your@email.example.org>` Signed-off-by: guoguangwu <guoguangwug@gmail.com>
2024-07-27Fix: Edited messages appear twice in fulltext search (#3363)Alex
As stated in https://github.com/matrix-org/dendrite/issues/3358 the search response contains both original and edited message. This PR fixes it by removing of the original message from the fulltext index after indexing the edit message event. I also made some cosmetic changes/fixes i found in the code Signed-off-by: `Alexander Dubovikov <d.lexand@gmail.com>`
2024-07-27Fix parsing ?ts query param (#3396)Tulir Asokan
Signed-off-by: Tulir Asokan <tulir@maunium.net>
2024-05-01Take advantage of changes in recent Go versions (#3361)0x1a8510f2
Given that #2714 wasn't merged but we are now at a minimum supported Go version of 1.20 (soon to be 1.21), I wanted to carry over some of the changes. Namely: - Fix the log typo - Simplify build constraints for unix - Use stdlib atomic package ### Pull Request Checklist <!-- Please read https://matrix-org.github.io/dendrite/development/contributing before submitting your pull request --> * [x] I have added Go unit tests or [Complement integration tests](https://github.com/matrix-org/complement) for this PR _or_ I have justified why this PR doesn't need tests * [x] Pull request includes a [sign off below using a legally identifiable name](https://matrix-org.github.io/dendrite/development/contributing#sign-off) _or_ I have already signed off privately Signed-off-by: `0x1a8510f2 <admin@0x1a8510f2.space>` --------- Co-authored-by: devonh <devon.dmytro@gmail.com>
2024-03-28Fix spaces over federation (#3347)Till
Fixes #2504 A few issues with the previous iteration: - We never returned `inaccessible_children`, which (if I read the code correctly), made Synapse raise an error and thus not returning the requested rooms - For restricted rooms, we didn't return the list of allowed rooms
2024-03-22Add getting/deleting single event report (#3344)Till
Based on https://github.com/matrix-org/dendrite/pull/3342 Adds `GET /_synapse/admin/v1/event_reports/{reportID}` and `DELETE /_synapse/admin/v1/event_reports/{reportID}`
2024-03-22Add `/_synapse/admin/v1/event_reports` endpoint (#3342)Till
Based on #3340 This adds a `/_synapse/admin/v1/event_reports` endpoint, the same Synapse has. This way existing tools also work with Dendrite. Given this is already getting huge (even though many test lines), splitting this into two PRs. (The next adds "getting one report" and "deleting reports") [skip ci]
2024-03-21Add event reporting (#3340)Till
Part of #3216 and #3226 There will be a follow up PR which is going to add the same admin endpoints Synapse has, so existing tools also work for Dendrite.
2024-02-21Speed up start up time by batch querying ACL events (#3334)Till
This should significantly speed up start up times on servers with many rooms.
2024-02-19Remove unused `token` (#3331)Till
Part of https://github.com/matrix-org/dendrite/issues/3225
2024-02-13Fix `/createRoom` and `/invite` containing displayname/avatarURL of inviter ↵Till
(#3326) Fixes #3324
2024-01-25Move `/joined_members` back to the clientapi/roomserver (#3312)Till
Partly reverts #2827 by moving `/joined_members` back to the clientAPI/roomserver
2024-01-20Don't send device list updates upon registration (#3307)Till
Fixes https://github.com/matrix-org/dendrite/issues/3273 As we otherwise send down device list updates which are merely useful for the user and causes tests to be flakey: ``` ❌ TestPushSync/Adding_a_push_rule_wakes_up_an_incremental_/sync (10ms) push_test.go:57: no pushrules found in sync response: {"next_batch":"s0_0_0_0_0_1_1_0_1","device_lists":{"changed":["@user-1:hs1"]}} ``` What this does: If a `PerformDeviceCreation` request is coming from registering an account, it does **not** send device list updates, as they are merely useful (no joined rooms, no one to inform) . In all other cases, the behavior is unchanged and device list updates are sent as usual.
2024-01-09Return `M_INVALID_PARAM` instead of `M_BAD_JSON` when setting aliases (#3297)Till
Part of https://github.com/matrix-org/dendrite/issues/3223 (https://github.com/matrix-org/matrix-spec/pull/1286) (For `DELETE` we don't validate the alias, but just return a 404 if we can't find it)
2023-11-24Appservice Login (2nd attempt) (#3078)KuhnChris
Rebase of #2936 as @vijfhoek wrote he got no time to work on this, and I kind of needed it for my experiments. I checked the tests, and it is working with my example code (i.e. impersonating, registering, creating channel, invite people, write messages). I'm not a huge `go` pro, and still learning, but I tried to fix and/or integrate the changes as best as possible with the current `main` branch changes. If there is anything left, let me know and I'll try to figure it out. Signed-off-by: `Kuhn Christopher <kuhnchris+git@kuhnchris.eu>` --------- Signed-off-by: Sijmen <me@sijman.nl> Signed-off-by: Sijmen Schoon <me@sijman.nl> Co-authored-by: Sijmen Schoon <me@sijman.nl> Co-authored-by: Sijmen Schoon <me@vijf.life> Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
2023-11-22Allow users to kick themselves (#3157)BtbN
As per the spec: https://spec.matrix.org/v1.7/rooms/v10/#authorization-rules "If membership is leave" -> "If the sender matches state_key, allow if and only if that user’s current membership state is invite, join, or knock." I.e. a user can kick themselves. Bridges use this to make a user leave while giving a reason. Some recent change (likely https://github.com/matrix-org/dendrite/commit/8ea1a11105ea7e66aa459537bcbef0de606147cd but I'm not 100% sure) changed that behaviour, resulting in heisenbridge being unable to make users leave while giving a reason. This works fine on Synapse. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org> Co-authored-by: kegsay <7190048+kegsay@users.noreply.github.com>
2023-11-22Refactor registration tests, remove hard-coded username validation (#3138)CicadaCinema
### Pull Request Checklist * [x] I have added Go unit tests or [Complement integration tests](https://github.com/matrix-org/complement) for this PR _or_ I have justified why this PR doesn't need tests * [x] I have already signed off privately This PR is in preparation for #3137 and removes the hard-coded username validation (previously only dependent on `forceEmpty`). --------- Co-authored-by: kegsay <7190048+kegsay@users.noreply.github.com>
2023-11-09Use `IsBlacklistedOrBackingOff` to determine if we should try to fetch ↵Till
devices (#3254) Use `IsBlacklistedOrBackingOff` from the federation API to check if we should fetch devices. To reduce back pressure, we now only queue retrying servers if there's space in the channel.
2023-10-31Some tweaks for the device list updater (#3251)Till
This makes the following changes: - Adds two new metrics observing the usage of the `DeviceListUpdater` workers - Makes the number of workers configurable - Adds a 30s timeout for DB requests when receiving a device list update over federation
2023-10-25clean up dead links, fix typo (#3130)CicadaCinema
I fixed any dead links beginning https://matrix.org/speculator and some issues I found along the way. https://web.archive.org/web/20190329152312/https://matrix.org/speculator/spec/HEAD/client_server/unstable.html#user-interactive-authentication-api is now found at https://spec.matrix.org/v1.7/client-server-api/#user-interactive-authentication-api https://web.archive.org/web/20170620093435/https://matrix.org/speculator/spec/HEAD/client_server/unstable.html#post-matrix-client-unstable-register is now found at https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3register https://github.com/matrix-org/matrix-spec/blob/2a8d64fef7a40717ef9f5748ee0551b2117be037/specification/intro.rst?plain=1#L443 is now found at https://spec.matrix.org/v1.7/appendices/#user-identifiers
2023-10-24Implement MSC3987, fix setting Element Android notifications (#3242)Till
Should fix https://github.com/matrix-org/dendrite/issues/3183, since Element Android already implements [MSC3987](https://github.com/vector-im/element-android/pull/8530) This is also part of https://github.com/matrix-org/dendrite/issues/3225
2023-10-23Fix state resets (#3231)Till
Needs https://github.com/matrix-org/gomatrixserverlib/pull/419 May fix: https://github.com/matrix-org/dendrite/issues/2508, https://github.com/matrix-org/dendrite/issues/1760
2023-09-27Support for room version v11 (#3204)Till
Fixes #3203
2023-09-26Complement fixes for pseudoIDs (#3206)devonh
2023-09-15Move pseudoID ClientEvent hotswapping to a common location (#3199)devonh
Fixes a variety of issues where clients were receiving pseudoIDs in places that should be userIDs. This change makes pseudoIDs work with sliding sync & element x. --------- Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
2023-09-15Update gmsl to use new validated RoomID on PDUs (#3200)devonh
GMSL returns a `spec.RoomID` when calling `PDU.RoomID()`
2023-08-31Handle event_format federation in /sync responses (#3192)devonh
2023-08-24Add configuration option for sliding sync when hosting ↵devonh
/.well-known/matrix/client (#3189) Adds the `org.matrix.msc3575.proxy` field (used for configuring sliding sync) to /.well-known/matrix/client when Dendrite is serving that endpoint and `well_known_sliding_sync_proxy` has been configured. ie. Config values of: ``` yaml global: well_known_client_name: https://example.com well_known_sliding_sync_proxy: https://syncv3.example.com ``` results in a /.well-known/matrix/client of: ``` json { "m.homeserver": { "base_url": "https://example.com" }, "org.matrix.msc3575.proxy": { "url": "https://syncv3.example.com" } } ``` If `well_known_sliding_sync_proxy` is not provided, the json provided by /.well-known/matrix/client does not include the proxy field. ie. ``` json { "m.homeserver": { "base_url": "https://example.com" } } ```
2023-08-24[pseudoIDs] More pseudo ID fixes - Part 2 (#3181)Sam Wedgwood
Fixes include: - Translating state keys that contain user IDs to their respective room keys for both querying and sending state events - **NOTE**: there may be design discussion needed on what should happen when sender keys cannot be found for users - A simple fix for kicking guests from rooms properly - Logic for boundary history visibilities was slightly off (I'm surprised this only manifested in pseudo ID room versions) Signed-off-by: `Sam Wedgwood <sam@wedgwood.dev>`
2023-08-15[pseudoID] More pseudo ID fixes (#3167)Sam Wedgwood
Signed-off-by: `Sam Wedgwood <sam@wedgwood.dev>`
2023-08-08Add config key for default room version (#3171)Sam Wedgwood
This PR adds a config key `room_server.default_config_key` to set the default room version for the room server. Signed-off-by: `Sam Wedgwood <sam@wedgwood.dev>`
2023-08-02Use `*spec.SenderID` for `QuerySenderIDForUser` (#3164)Sam Wedgwood
There are cases where a dendrite instance is unaware of a pseudo ID for a user, the user is not a member of that room. To represent this case, we currently use the 'zero' value, which is often not checked and so causes errors later down the line. To make this case more explict, and to be consistent with `QueryUserIDForSender`, this PR changes this to use a pointer (and `nil` to mean no sender ID). Signed-off-by: `Sam Wedgwood <sam@wedgwood.dev>`
2023-07-31[pseudoIDs] Fixes for room alias tests (#3159)Sam Wedgwood
Some (deceptively) simple fixes for some bugs that caused room alias tests to fail (sytext `tests/30rooms/05aliases.pl`). Each commit has details about what it fixes. Sytest results: - Sytest before (79d4a0e): https://gist.github.com/swedgwood/972ac4ef93edd130d3db0930703d6c82 - Sytest after (4b09bed): https://gist.github.com/swedgwood/504b00ac4ee892acb757b7fac55fa28a Room aliases go from `8/15` to `15/15`, but looks like these fixes also managed to fix about `4` other tests, which is a nice bonus :) Signed-off-by: `Sam Wedgwood <sam@wedgwood.dev>`
2023-07-20de-MSC-ifying space summaries (MSC2946) (#3134)helm-dendrite-0.13.1Sam Wedgwood
- This PR moves and refactors the [code](https://github.com/matrix-org/dendrite/blob/main/setup/mscs/msc2946/msc2946.go) for [MSC2946](https://github.com/matrix-org/matrix-spec-proposals/pull/2946) ('Space Summaries') to integrate it into the rest of the codebase. - Means space summaries are no longer hidden behind an MSC flag - Solves #3096 Signed-off-by: Sam Wedgwood <sam@wedgwood.dev>
2023-07-06Add pseudoID compatibility to Invites (#3126)devonh
2023-06-28Add `MXIDMapping` for pseudoID rooms (#3112)Till
Add `MXIDMapping` on membership events when creating/joining rooms.
2023-06-28Fix setting `displayname` and `avatar_url` (#3125)Till
As per the spec, `displayname` and `avatar_url` may be empty.
2023-06-22feat: admin APIs for token authenticated registration (#3101)santhoshivan23
### Pull Request Checklist <!-- Please read https://matrix-org.github.io/dendrite/development/contributing before submitting your pull request --> * [x] I have added Go unit tests or [Complement integration tests](https://github.com/matrix-org/complement) for this PR _or_ I have justified why this PR doesn't need tests * [x] Pull request includes a [sign off below using a legally identifiable name](https://matrix-org.github.io/dendrite/development/contributing#sign-off) _or_ I have already signed off privately Signed-off-by: `Santhoshivan Amudhan santhoshivan23@gmail.com`
2023-06-14Merge SenderID & Per Room User Key work (#3109)devonh
2023-06-12Cleanup remaining statekey usage for senderIDs (#3106)devonh
2023-06-07Use SenderID Type (#3105)devonh
2023-06-06PDU Sender split (#3100)devonh
Initial cut of splitting PDU Sender into SenderID & looking up UserID where required.
2023-05-31Move Invite logic to GMSL (#3086)devonh
This is both the federation receiving & sending side logic (which were previously entangeld in a single function)
2023-05-31Move CreateRoom logic to Roomserver (#3093)devonh
Move create room logic over to roomserver.
2023-05-30Fix potential state reset when trying to join a room (#3040)Till
When trying to join a room in short sequence, it is possible that a state reset occurs. This fixes it by using `singleflight`.
2023-05-30Docs restructure (#2953)Till
Needs to be merged into `gh-pages` later on.
2023-05-24Drop `reference_sha` column (#3083)Till
Companion PR to https://github.com/matrix-org/gomatrixserverlib/pull/383
2023-05-17Move MakeJoin logic to GMSL (#3081)devonh