Commit graph

2291 commits

Author SHA1 Message Date
Neil Alexander 4c3810a76b
Merge branch 'main' into neilalexander/purgeroom 2022-09-01 09:26:14 +01:00
Neil Alexander ad6b902b84
Refactor appservices component (#2687)
This PR refactors the app services component. It makes the following changes:

* Each appservice now gets its own NATS JetStream consumer
* The appservice database is now removed entirely, since we just use JetStream as a data source instead
* The entire component is now much simpler and we deleted lots of lines of code 💅

The result is that it should be much lighter and hopefully much more performant.
2022-09-01 09:20:40 +01:00
Neil Alexander 175f65407a
Allow batching in JetStreamConsumer (#2686)
This allows us to receive more than one message from NATS at a time if we want.
2022-08-31 12:21:56 +01:00
Neil Alexander ba0b3adab4
Pinecone standalone refactoring (#2685)
This refactors the `dendrite-demo-pinecone` executable so that it:

1. Converts the old `.key` file into a standard `.pem` file
2. Allows passing in the `--config` option to supply a normal Dendrite configuration file, so that you can configure PostgreSQL instead of SQLite, appservices and all the other usual stuff
2022-08-31 10:41:32 +01:00
Neil Alexander 9a4ff4f128
Merge branch 'main' into neilalexander/purgeroom 2022-08-30 22:22:25 +01:00
Neil Alexander 02ec00b1bb
Check for "creator" field in m.room.create during event auth (update to matrix-org/gomatrixserverlib@c71e518) 2022-08-30 17:40:46 +01:00
Neil Alexander e1eccbbfb7
Merge branch 'main' into neilalexander/purgeroom 2022-08-30 16:38:42 +01:00
PiotrKozimor 2be43560ca
Index on syncapi_send_to_device table (#2684)
Introduced index improves select query performance. Example execution time of `selectSendToDeviceMessagesSQL` query dropped from 80 ms to 15 ms. No sytest modifications are required.

### Pull Request Checklist

* [x] I have added added tests for PR _or_ I have justified why this PR doesn't need tests.
* [x] Pull request includes a [sign off](https://github.com/matrix-org/dendrite/blob/main/docs/CONTRIBUTING.md#sign-off)

Signed-off-by: `Piotr Kozimor <p1996k@gmail.com>`
2022-08-30 14:47:54 +01:00
Till 93a6e2f4d3
Set the notification count when sending push notifications (#2683) 2022-08-30 14:54:57 +02:00
Till 7313f56f44
Use existing limit instead of default limit when lazy loading members (#2682)
This should fix an issue where we return less than the expected membership events, when doing an initial sync.
When doing an initial sync, the state limit is set to `math.MaxInt32`, while the default filter is set to 20.
2022-08-30 14:18:47 +02:00
Till b0e2ea0f37
Fix race condition on startup (#2679)
`SetupAndServeHTTP` would race in `configureHTTPErrors` and while configuring routes.
2022-08-30 13:59:13 +02:00
Neil Alexander bbb3ade4a2
Fix the Cat Overflow bug (update to matrix-org/gomatrixserverlib@2020bdc) 2022-08-30 11:44:26 +01:00
Till Faelligen 21ef487ff8
Log roomserver error 2022-08-29 14:18:33 +02:00
Brian Meek 704cc5c9f5
Race in keyserver intialization (#2619)
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-08-29 09:10:42 +02:00
Till Faelligen aba171d9bc
Default to limit of 20 state events 2022-08-29 07:23:46 +02:00
Neil Alexander 08a0dd5932
Merge branch 'main' into neilalexander/purgeroom 2022-08-28 09:54:41 +01:00
Neil Alexander a3eb4e5e98
Enforce type, sender, state_key and room_id lengths using codepoints rather than bytes (update to matrix-org/gomatrixserverlib@5f66df0, matrix-org/matrix-spec#1001) 2022-08-28 09:52:03 +01:00
Neil Alexander 38bed30b41
Restrict username length properly (#2676)
This fixes #2674 by fixing the username check to comply with the [spec appendices](https://spec.matrix.org/v1.3/appendices/#user-identifiers):

> The length of a user ID, including the @ sigil and the domain, MUST NOT exceed 255 characters.
2022-08-26 09:56:41 +01:00
Neil Alexander ef0dcf6bee
Use background context, don't fall through 2022-08-25 14:38:19 +01:00
Neil Alexander 1622df2499
Merge branch 'main' into neilalexander/purgeroom 2022-08-25 14:37:07 +01:00
Neil Alexander ed79e8626a
Version 0.9.5 (#2673)
Changelog and version bump.
2022-08-25 14:14:10 +01:00
Till 07dd9bd995
SyncAPI tweaks/fixes (#2671)
- Reverts 9dc57122d9 as it was causing issues https://github.com/matrix-org/dendrite/issues/2660
- Updates the GMSL `DefaultStateFilter` to use a limit of 20 events
- Uses the timeline events to determine the new position instead of the state events
2022-08-25 13:42:47 +01:00
Neil Alexander 11856a502e
Merge branch 'main' into neilalexander/purgeroom 2022-08-25 12:11:15 +01:00
Neil Alexander b7258dcc00
Let the roomserver work first 2022-08-25 12:11:00 +01:00
Neil Alexander c1d6e18152
Lock the room during a purge operation to prevent other input events from populating mid-operation 2022-08-25 12:09:34 +01:00
Neil Alexander 8ff3f1a7c9
Remove a couple unnecessary Sentry captures from backfill 2022-08-25 11:01:07 +01:00
Neil Alexander cd7fa34595
Tweak logging and Sentry reporting for roomserver input 2022-08-25 10:57:27 +01:00
Neil Alexander 295ba38937
Merge branch 'main' into neilalexander/purgeroom 2022-08-25 10:00:27 +01:00
Neil Alexander 16156b0b09
Fix 500s on /state, /state_ids when state not known (#2672)
This was due to bad error bubbling.
2022-08-25 09:51:36 +01:00
Neil Alexander 965f532bb0
Merge branch 'main' into neilalexander/purgeroom 2022-08-24 14:47:11 +01:00
Neil Alexander 522bd2999f
Allow un-rejecting events on reprocessing 2022-08-24 14:03:06 +01:00
Till 78e5d05efc
Only set backOffStarted to false if until is not zero (#2669) 2022-08-23 16:54:42 +02:00
Neil Alexander 14fea600bb
Detect types.MissingStateError in CheckServerAllowedToSeeEvent (#2667)
This will hopefully stop some 500 errors on `/event` where there is no state-before known.
2022-08-23 13:57:11 +01:00
Till 95a509757a
Complement QoL changes (#2663)
This PR does the following:
- adds a `keysize` parameter to `generate-keys`, so we can use lower sized keys when running in CI
- updates the Complement docker files to use BuildKit (requires Docker >18.09)
- uses `exec` when executing `dendrite-monotlith-server`, making it PID 1 inside docker, which results in Dendrite actually receiving the `SIGTERM` signal send by Docker. (Making it faster when running tests with Complement, as we don't take 10 seconds to timeout)
2022-08-23 13:10:29 +02:00
Till 33129c02f7
Add timeout parameter & trim URL (#2666)
A timeout of 10 seconds could cause issues with servers having a high `bcrypt_cost` configured in the config.
This adds a parameter to manually configure the timeout, defaults to 30 seconds.
2022-08-23 11:10:41 +02:00
Neil Alexander e31469682d
Send the output event first 2022-08-22 14:14:29 +01:00
Neil Alexander 4e4fc400a2
Consolidate purge statements as they need to be prepared after other tables are created 2022-08-22 13:48:09 +01:00
Neil Alexander 468d4b5bbe
Fix joined hosts 2022-08-22 13:15:56 +01:00
Neil Alexander b452d774e4
Purge the federation API 2022-08-22 13:13:58 +01:00
Neil Alexander cd81635cf4
Let us retry 2022-08-22 12:52:22 +01:00
Neil Alexander db9ca401b0
Wire that up 2022-08-22 12:49:04 +01:00
Neil Alexander 53e218914d
Purge sync API too 2022-08-22 12:45:58 +01:00
Neil Alexander c45bf118a8
Send output event for purge 2022-08-22 12:27:17 +01:00
Neil Alexander 4c4de0dfc6
Purge the room entry too 2022-08-22 12:05:38 +01:00
Neil Alexander b56011514b
Fix a query 2022-08-22 12:01:23 +01:00
Neil Alexander 83c7984dba
Fix table name 2022-08-22 11:58:17 +01:00
Neil Alexander 6442aea104
Fix API trace 2022-08-22 11:57:00 +01:00
Neil Alexander 856fe9d62b
Try adding an endpoint for it 2022-08-22 11:55:22 +01:00
Neil Alexander c1dcd5b218
SQLite stubs 2022-08-22 11:49:46 +01:00
Neil Alexander d11c243599
More PostgreSQL purging 2022-08-22 11:46:44 +01:00