Commit graph

1633 commits

Author SHA1 Message Date
Till Faelligen 3e62a638b1 Add trace for new endpoints 2021-08-05 08:45:07 +02:00
Till Faelligen 4b94f52ce4 Merge branch 'master' of https://github.com/matrix-org/dendrite into add-presence 2021-08-05 08:38:58 +02:00
Neil Alexander eb0efa4636
Cross-signing groundwork (#1953)
* Cross-signing groundwork

* Update to matrix-org/gomatrixserverlib#274

* Fix gobind builds, which stops unit tests in CI from yelling

* Some changes from review comments

* Fix build by passing in UIA

* Update to matrix-org/gomatrixserverlib@bec8d22

* Process master/self-signing keys from devices call

* nolint

* Enum-ify the key type in the database

* Process self-signing key too

* Fix sanity check in device list updater

* Fix check

* Fix sytest, hopefully

* Fix build
2021-08-04 17:56:29 +01:00
kegsay 4cc8b28b7f
Ensure all create events have a snapshot NID of 0 (#1961)
Fixes #1924 for postgres users, though the underlying cause of why
they aren't 0 in the first place is unresolved.
2021-08-04 17:48:23 +01:00
Neil Alexander 7a9a2547b3
Cross-signing storage code (#1959) 2021-08-04 17:31:18 +01:00
kegsay ed04eed441
Fix sqlite migration issues (#1960)
* Do not store 'null' in the database for empty JSON arrays

This can cause issues, though it should be noted that the majority
of the time this will marshal/unmarshal just fine, see
https://play.golang.org/p/Doe2NZUgv7Q

* bugfix: sqlite migration should handle create events as having no 'before' snapshot

The state snapshot for any given event in the roomserver represents the state _before_
the event. For the create event, this is nothing, so the state snapshot nid should be 0.

In some cases this wasn't happening, resulting in a nice mix of possible options including:
 - A state snapshot without any state blocks `[]` or `null`.
 - A state snapshot with a single state block with a single event, the create event, causing
   a circular loop. This is incorrect as it represents the state before the event, not after.

* Add state key check
2021-08-04 17:08:17 +01:00
Till Faelligen 642ac3e4ad Add Setup method to PresenceStreamProvider 2021-08-03 15:32:34 +02:00
Till Faelligen 7003ae501d Add possibilty to query current max id for presence 2021-08-03 15:23:37 +02:00
Neil Alexander da101469fa
Minimum version Go 1.15 (#1957) 2021-08-03 11:35:29 +01:00
kegsay e3df612953
Add tracing to user API (#1948)
Use the trace version in tests so we can just implement the required API functions.
2021-08-03 11:23:25 +01:00
Neil Alexander d4aa311c74
Update containerd dependency 2021-08-03 11:17:27 +01:00
Neil Alexander a81c499f65
Update dependencies (#1956) 2021-08-03 11:15:17 +01:00
Till Faelligen 040bce77d2 Update logging 2021-08-03 11:37:39 +02:00
kegsay a22ab3eee6
Read the right username field when performing account deactivation (#1954)
`Login` has 2 username fields, and we were always checking the
deprecated one. Instead, check both.
2021-08-02 13:11:23 +01:00
Till Faelligen f1a19e74d7 Add presence federationsender 2021-08-01 10:28:43 +02:00
S7evinK 04f85e8e50
Merge branch 'master' into add-presence 2021-07-31 20:19:35 +02:00
Till Faelligen 3e937e43ef Update go.mod.. 2021-07-31 19:40:10 +02:00
Till Faelligen dc081bb94f Update go.mod to use correct replacement 2021-07-31 19:37:20 +02:00
Till Faelligen 167c07bd6f Fix tests 2021-07-31 19:32:38 +02:00
Till Faelligen 4f204a68d1 Testing 2021-07-31 16:26:38 +02:00
Till Faelligen bdc30e57a5 Test 2021-07-31 16:26:15 +02:00
Till Faelligen 0889ceeac2 Make /sync requests work 2021-07-31 16:10:46 +02:00
Till Faelligen 9dee04c21a Test 2021-07-30 21:38:26 +02:00
Till Faelligen 7347f403dd Merge remote-tracking branch 'origin/add-presence' into add-presence 2021-07-30 09:01:16 +02:00
Till Faelligen 62295ecd70 - Avoid clearing status_msg when going idle
- Fix issue with last_active_ago not beeing set
- Add missing internal server api
- Use currval (the actual next free) for the new id
- Fix copy&paste error
2021-07-30 09:00:52 +02:00
Kegan Dougal ed4097825b Factor out StatementList to sqlutil and use it in userapi
It helps with the boilerplate.
2021-07-28 18:30:04 +01:00
Till Faelligen 9f5f41c290 Fix copy&paste error 2021-07-28 17:27:57 +02:00
Till Faelligen 6f6a1d32c3 Make lint and tests happy 2021-07-28 17:13:55 +02:00
Till Faelligen bf8211b654 Add missing files 2021-07-28 16:52:04 +02:00
Till Faelligen f759107604 Merge branch 'master' of https://github.com/matrix-org/dendrite into add-presence 2021-07-28 16:46:28 +02:00
Till Faelligen 3b55742b4e Add missing PresenceStatus type 2021-07-28 16:42:25 +02:00
Till Faelligen 0ce356c45a Add configuration for the presence database 2021-07-28 16:41:35 +02:00
Till Faelligen e96b8c0e79 Add passing tests to whitelist
Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
2021-07-28 16:38:03 +02:00
Till Faelligen f74a310dff Let users set/retrieve the presence status from clientapi 2021-07-28 16:36:43 +02:00
Till Faelligen e0f9c663e2 Add presence storage
Add internal API to set/retrieve the presence status
2021-07-28 16:32:32 +02:00
Neil Alexander 9e4618000e
Alias key backup endpoints onto /unstable, fix key backup bugs (#1947)
* Default /unstable requests to stable endpoints if not overridden specifically with a custom route

* Rewrite URL

* Try something different

* Fix routing manually

* Fix selectLatestVersionSQL

* Don't return 0 if no backup version exists

* Log more useful error

* fix up replace keys check

* Don't enforce uniqueness on e2e_room_keys_versions_idx

Co-authored-by: kegsay <kegan@matrix.org>
2021-07-28 10:25:45 +01:00
Neil Alexander 3e01a88a0c
Update to neilalexander/utp@54ae7b1 2021-07-27 21:34:40 +01:00
kegsay 32bf14a37c
Key Backups (3/3) : Implement querying keys and various bugfixes (#1946)
* Add querying device keys

Makes a bunch of sytests pass

* Apparently only the current version supports uploading keys

* Linting
2021-07-27 19:29:32 +01:00
kegsay b3754d68fc
Key Backups (2/3) : Add E2E backup key tables (#1945)
* Add PUT key backup endpoints and glue them to PerformKeyBackup

* Add tables for storing backup keys and glue them into the user API

* Don't create tables whilst still WIPing

* writer on sqlite please

* Linting
2021-07-27 17:08:53 +01:00
kegsay a060df91e2
Use db writer on sqlite account table (#1944) 2021-07-27 12:47:50 +01:00
kegsay 32538640db
Key backups (1/2) : Add E2E session backup metadata tables (#1943)
* Initial key backup paths and userapi API

* Fix unit tests

* Add key backup table

* Glue REST API to database

* Linting

* use writer on sqlite
2021-07-27 12:47:32 +01:00
Neil Alexander e3679799ea
Version 0.4.1 2021-07-26 12:52:11 +01:00
kegsay 16bf94f239
Not finding the snapshot is not fatal (#1940) 2021-07-26 12:30:44 +01:00
Meenal Trivedi fa1ec482a7
fix:Inviting to an unsupported room version return M_BAD_JSON instead of Incompatible_Version (#1930)
* fix:Inviting to an unsupported room version return M_BAD_JSON instead of M_UNSUPPORTED_ROOM_VERSION

Signed-off-by: Meenal Trivedi <meenaltrivedi6102@gmail.com>

* fix

Signed-off-by: Meenal Trivedi <meenaltrivedi6102@gmail.com>

* fix

Signed-off-by: Meenal Trivedi <meenaltrivedi6102@gmail.com>

* feat: make requested changes

Signed-off-by: Meenal Trivedi <meenaltrivedi6102@gmail.com>

* Use error typecast from matrix-org/gomatrixserverlib#272

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2021-07-26 10:41:58 +01:00
Till Faelligen 139817a0b3 Merge branch 'master' of https://github.com/matrix-org/dendrite into add-presence 2021-07-23 20:46:35 +02:00
Neil Alexander 75d0f009ec
Don't set prev state when it is the same as the event it replaces (#1936) 2021-07-22 16:46:36 +01:00
Neil Alexander 39e8d1cc6f
Track knocking in membership updater (#1935)
* Topologically sort outliers in SendEventWithState

* Knock in membership updater

* Update gomatrixserverlib

* Update gomatrixserverlib

* Get the NID of the knock event properly for the membership updater
2021-07-22 12:26:58 +01:00
Neil Alexander 43ac66e0b4
Update to matrix-org/gomatrixserverlib@b9eb787 2021-07-22 09:46:31 +01:00
Neil Alexander 9008b1c111
Update to matrix-org/gomatrixserverlib@ae88543 2021-07-21 18:46:31 +01:00
Neil Alexander 7650998308
Update to matrix-org/gomatrixserverlib#271 2021-07-21 17:21:15 +01:00