Commit graph

2287 commits

Author SHA1 Message Date
Neil Alexander 59991bc86a
Update state reset capture to Sentry 2022-09-12 15:05:07 +01:00
Till 6d09f3da51
Add HTTP status code to FederationClientError (#2699)
Also ensures we wait on more HTTP status codes.
2022-09-12 15:05:07 +01:00
Till 9d2d585c56
Avoid unneeded JSON operations (#2698)
We were `json.Unmarshal`ing the EDU and `json.Marshal`ing right before
sending the EDU to the stream. Those are now removed and the consumer
does `json.Unmarshal` once.
2022-09-12 15:05:07 +01:00
Till Faelligen af17cad587
Re-add waitTime if we're not blacklisted and no RetryAfter was
specified.
2022-09-12 15:05:06 +01:00
Till 64d8f7d8de
Add a SigningKeyUpdate producer (#2697)
This adds a new stream for signing key updates, this should ensure we
don't lose any updates over federation.
2022-09-12 15:05:06 +01:00
Till 2181f50490
Handle errors differently in the DeviceListUpdater (#2695)
`If a device list update goes missing, the server resyncs on the next
one` was failing because a previous test would receive a `waitTime` of
1h, resulting in the test timing out.
This now tries to handle the returned errors differently, e.g. by using
the default `waitTime` of 2s. Also doesn't try further users in the
list, if one of the errors would cause a longer `waitTime`.
2022-09-12 15:05:06 +01:00
Neil Alexander 8a2d1cc980
Update to matrix-org/gomatrixserverlib@637a173 2022-09-12 15:05:06 +01:00
Neil Alexander a266d4d972
Stronger default power levels 2022-09-12 15:05:06 +01:00
Neil Alexander d1209f5ef3
State resolution fixes in applyAndAuthEvent (update to matrix-org/gomatrixserverlib#336) 2022-09-12 15:05:06 +01:00
Neil Alexander 0db775e080
Tweak Sentry again 2022-09-12 15:05:05 +01:00
Neil Alexander 2823153f87
Set Sentry user where known 2022-09-12 15:05:05 +01:00
Neil Alexander e92d2985f0
Improve Sentry reporting 2022-09-12 15:05:05 +01:00
Neil Alexander 34acfc4fe3
Tweak logging for detected state resets 2022-09-12 15:05:05 +01:00
Neil Alexander 6d1c994991
State and auth tweaks (update to matrix-org/gomatrixserverlib#335) 2022-09-12 15:05:05 +01:00
Neil Alexander e4fee11ff9
Optimise resolve-state tool 2022-09-12 15:05:05 +01:00
Neil Alexander 9d0bc2946b
Move SetLatestEvents call 2022-09-12 15:05:04 +01:00
Till e811ceb13b
Only send (invite) events to the AS if it's interested in it (#2692)
This should hopefully fix #2691 (and maybe also #2690)
2022-09-12 15:05:04 +01:00
Neil Alexander 3d0c1656be
Update P2P demos 2022-09-12 15:05:01 +01:00
Neil Alexander 160a2ed67e
Version 0.9.6 (#2689)
Changelog and version bump.
2022-09-12 15:03:28 +01:00
Neil Alexander 3ea000947e
Configuration tweaks (#2567)
This makes the following changes:

* The various `Defaults` functions are now responsible for setting sane defaults if `generate` is specified, rather than hiding them in `generate-config`
* Some configuration options have been marked as `omitempty` so that they don't appear in generated configs unnecessarily (monolith-specific vs. polylith-specific options)
* A new option `-polylith` has been added to `generate-config` to create a config that makes sense for polylith deployments (i.e. including the internal/external API listeners and per-component database sections)
* A new option `-normalise` has been added to `generate-config` to take an existing file and add any missing options and/or defaults
2022-09-12 15:03:28 +01:00
Neil Alexander 638382a5b8
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-12 15:03:28 +01:00
Neil Alexander d2feb57df6
Allow batching in JetStreamConsumer (#2686)
This allows us to receive more than one message from NATS at a time if we want.
2022-09-12 15:03:28 +01:00
Neil Alexander f2a6114279
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-09-12 15:03:28 +01:00
Neil Alexander 10f52376bd
Check for "creator" field in m.room.create during event auth (update to matrix-org/gomatrixserverlib@c71e518) 2022-09-12 15:03:27 +01:00
PiotrKozimor 0caa0adfa8
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-09-12 15:03:27 +01:00
Till 31a27bdb14
Set the notification count when sending push notifications (#2683) 2022-09-12 15:03:27 +01:00
Till e5beaa010b
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-09-12 15:03:27 +01:00
Till ac09137409
Fix race condition on startup (#2679)
`SetupAndServeHTTP` would race in `configureHTTPErrors` and while configuring routes.
2022-09-12 15:03:18 +01:00
Neil Alexander dfa1f5d218
Fix the Cat Overflow bug (update to matrix-org/gomatrixserverlib@2020bdc) 2022-09-12 14:59:27 +01:00
Till Faelligen 9ffefa5fd6
Log roomserver error 2022-09-12 14:59:27 +01:00
Brian Meek d2877b034a
Race in keyserver intialization (#2619)
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-09-12 14:59:27 +01:00
Till Faelligen e7fbf06ec8
Default to limit of 20 state events 2022-09-12 14:59:26 +01:00
Neil Alexander 0fd37aac13
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-09-12 14:59:26 +01:00
Neil Alexander dcec7783b5
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-09-12 14:59:26 +01:00
Neil Alexander 5c8fb18d06
Version 0.9.5 (#2673)
Changelog and version bump.
2022-09-12 14:59:26 +01:00
Till 1fbbb25ed9
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-09-12 14:59:26 +01:00
Neil Alexander 20fe89bfcb
Remove a couple unnecessary Sentry captures from backfill 2022-09-12 14:59:26 +01:00
Neil Alexander e1053689c0
Tweak logging and Sentry reporting for roomserver input 2022-09-12 14:59:25 +01:00
Neil Alexander 7e0faea586
Fix 500s on /state, /state_ids when state not known (#2672)
This was due to bad error bubbling.
2022-09-12 14:59:25 +01:00
Neil Alexander a2f729a74a
Allow un-rejecting events on reprocessing 2022-09-12 14:59:25 +01:00
0x1a8510f2 6690282468
Switch to stdlib atomic
No need for `go.uber.org/atomic` anymore
2022-09-12 14:59:25 +01:00
0x1a8510f2 d42653643f
Don't raise fd limit + simplify build constraints
See https://github.com/matrix-org/dendrite/issues/2564
2022-09-12 14:58:49 +01:00
0x1a8510f2 af036a7efa
Fix typo 2022-09-10 01:31:55 +01:00
0x1a8510f2 88bc79f7f5
1.18 -> 1.19 find-and-replace 2022-09-10 01:31:28 +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 2668050e53
Tweak soft-failure handling in roomserver
commit 1929b688e31987c46e0c8a546f0f9cb0a46bf9a3
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Mon Aug 22 10:09:44 2022 +0100

    Still process state-before for soft-failed events

commit e83c0b701d40d78b92072c4643f6bc6f71b72800
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Mon Aug 22 10:06:50 2022 +0100

    Improve logging

commit 29e26124bc27cb83d449de2a4214b253c594aa93
Author: Neil Alexander <neilalexander@users.noreply.github.com>
Date:   Mon Aug 22 09:58:13 2022 +0100

    Don't store soft-failed events as rejected
2022-08-22 10:34:07 +01:00
Till 9dc57122d9
Fetch more data for newly joined rooms in an incremental sync (#2657)
If we've joined a new room in an incremental sync, try fetching more data.
This deflakes the complement server notices test (at least in my tests).
2022-08-19 15:32:24 +02:00