aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-02-17Don't re-send sent events in `add_state_events` (#2195)Neil Alexander
* Only add events to `add_state_events` that haven't already been sent to the roomserver output before * Filter on event NIDs instead, hopefully bring joy to SQLite * UnsentFilter, review comments
2022-02-17Fix potential panic in `NewStreamTokenFromString` caused by off-by-one error ↵Neil Alexander
(#2196) Line 291 could panic when trying to set `positions[i]` if `i == len(positions)`.
2022-02-17Raise waitTime for network related issues (#2192)S7evinK
2022-02-17Update NATS Server to v2.7.2 (#2193)Neil Alexander
* Update NATS JetStream to v2.7.2 * Remove deprecated option
2022-02-17Remove outbound proxy, http.ProxyFromEnvironment is now used (#2191)S7evinK
2022-02-17Set 'complement' as the shared secret for CI (#2194)kegsay
2022-02-16Add account type (#2171)S7evinK
* Add account_type for sqlite3 * Add account_type for postgres * Remove CreateGuestAccount from interface * Add new AccountTypes & update test * Use newly added AccountType for account creation * Add migrations * Reuse type * Add AccounnType to Device, so it can be verified on requests * Rename migration, add missing update for appservices * Rename sqlite3 migration * Add missing AccountType to return value * Update sqlite migration Change allowance check on /admin/whois * Fix migration, add IS NULL * Move accountType to completeRegistration * Fix migrations * Add passing test
2022-02-16Make "Device list doesn't change if remote server is down" pass (#2190)S7evinK
2022-02-16Don't panic on retiring an invite that we haven't seen yet (#2189)Neil Alexander
2022-02-15Add host mount compatible Complement image (#2187)kegsay
2022-02-15Update prometheusNeil Alexander
2022-02-15Update to matrix-org/gomatrixserverlib@20632ddNeil Alexander
2022-02-11Ensure only one transaction is used for RS input per room (#2178)Neil Alexander
* Ensure the input API only uses a single transaction * Remove more of the dead query API call * Tidy up * Fix tests hopefully * Don't do unnecessary work for rooms that don't exist * Improve error, fix another case where transaction wasn't used properly * Add a unit test for checking single transaction on RS input API * Fix logic oops when deciding whether to use a transaction in storeEvent
2022-02-11Remove FederationDisabled error type (#2174)S7evinK
2022-02-11Don't allow parallel complement tests (#2169)kegsay
Fixes flakiness seemingly. See https://github.com/matrix-org/synapse/pull/11910
2022-02-11Drop `m.room.create` events in federation `/send` transaction (#2179)Neil Alexander
2022-02-11Add postgres complement support (#2177)kegsay
2022-02-10Point to /complement/ca not /ca (#2172)kegsay
2022-02-10Version 0.6.3 (#2170)v0.6.3Neil Alexander
2022-02-10Support for `m.login.token` (#2014)tommie
* Add GOPATH to PATH in find-lint.sh. The user doesn't necessarily have it in PATH. * Refactor LoginTypePassword and Type to support m.login.token and m.login.sso. For login token: * m.login.token will require deleting the token after completeAuth has generated an access token, so a cleanup function is returned by Type.Login. * Allowing different login types will require parsing the /login body twice: first to extract the "type" and then the type-specific parsing. Thus, we will have to buffer the request JSON in /login, like UserInteractive already does. For SSO: * NewUserInteractive will have to also use GetAccountByLocalpart. It makes more sense to just pass a (narrowed-down) accountDB interface to it than adding more function pointers. Code quality: * Passing around (and down-casting) interface{} for login request types has drawbacks in terms of type-safety, and no inherent benefits. We always decode JSON anyway. Hence renaming to Type.LoginFromJSON. Code that directly uses LoginTypePassword with parsed data can still use Login. * Removed a TODO for SSO. This is already tracked in #1297. * httputil.UnmarshalJSON is useful because it returns a JSONResponse. This change is intended to have no functional changes. * Support login tokens in User API. This adds full lifecycle functions for login tokens: create, query, delete. * Support m.login.token in /login. * Fixes for PR review. * Set @matrix-org/dendrite-core as repository code owner * Return event NID from `StoreEvent`, match PSQL vs SQLite behaviour, tweak backfill persistence (#2071) Co-authored-by: kegsay <kegan@matrix.org> Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-02-10Allow user to forget a room, even if they never were a member (#2166)S7evinK
* Allow user to forget a room, even if they never were a member * Return "M_UNKNOWN" as per the spec Co-authored-by: kegsay <kegan@matrix.org>
2022-02-10Fix fetching missing state (#2163)Neil Alexander
* Check that we have a populated state snapshot when determining if we closed the gap * Do the same in the query API * Use HasState more opportunistically * Try to avoid falling down the hole of using a trustworthy but empty state snapshot for non-create events * Refactor missing state and make sure that we really solve the problem for the new event * Comments * Review comments * Tweak that check again * Tidy up that create check further * Fix build hopefully * Update sendOutliers to use OrderAuthAndStateEvents * Don't go out of bounds on missingEvents
2022-02-10Make the Complement Dockerfile use a fresh directory for runtime (#2168)kegsay
2022-02-10Fix transaction issues in events table in PSQL (#2165)Neil Alexander
* Revert "Revert "Fix storage bug in PSQL events table"" This reverts commit cf447dd52a0015c2c5b10813ed11e59a3712607e. * Membership updater to use updater * Fix membership updater to use transactions properly
2022-02-09Unmarshal events at the Dendrite level not GMSL level (#2164)kegsay
* Use new event json types in gmsl * Fix EventJSON to actually unmarshal events * Update GMSL * Bump GMSL and improve error messages * Send back the correct RespState * Update GMSL
2022-02-09Avoid unnecessary logs and marshaling (#2167)S7evinK
Co-authored-by: kegsay <kegan@matrix.org>
2022-02-09Fix sytest `uploading signed devices gets propagated over federation` (#2162)S7evinK
* Remove unneeded logging * Add MasterKey & SelfSigningKey to update Avoid panic if signatures are not present * Add passing test * Revert "Add MasterKey & SelfSigningKey to update" This reverts commit 2c81b34884be8b5b875a33420c0f985b578d3fb8. * Send MasterKey & SelfSigningKey with update * Debugging * Remove delete() so we also query signingkeys
2022-02-09Revert "Fix storage bug in PSQL events table"Neil Alexander
This reverts commit b4687f2ed24ae4f397e039776118c6efee306fa9.
2022-02-09Fix storage bug in PSQL events tableNeil Alexander
2022-02-08Remove OutputKeyChangeEvent consumer on keyserver (#2160)S7evinK
* Remove keyserver consumer * Remove keyserver from eduserver * Directly upload device keys without eduserver * Add passing tests
2022-02-08More relaxed auth event fetching (#2161)Neil Alexander
* Tweaks around auth event fetching * More tweaking
2022-02-08Demote logging entry for backoffNeil Alexander
2022-02-08Fix DendriteJS dockerfileNeil Alexander
2022-02-08Various updates for renaming the `master` branch to `main`Neil Alexander
2022-02-08Allow events to be un-rejected (#2159)Neil Alexander
* Allow un-rejecting an event later * SQL * Only un-reject, don't re-reject * Clarify ambiguous column reference
2022-02-08Update to matrix-org/gomatrixserverlib@a05e156fd8a0c7bd326cbdadfff2bc7b2a70b44aNeil Alexander
2022-02-07Fix bugs that could wedge rooms (#2154)Neil Alexander
* Don't flake so badly for rejected events * Moar * Fix panic * Don't count rejected events as missing * Don't treat rejected events without state as missing * Revert "Don't count rejected events as missing" This reverts commit 4b6139b62eb91ba059b47415b0275964b37d9b43. * Missing events should be KindOld * If we have state, use it, regardless of memberships which could be stale now * Fetch missing state for KindOld too * Tweak the condition again * Clean up a bit * Use room updater to get latest events in a race-free way * Return the correct error * Improve errors
2022-02-04Version 0.6.2v0.6.2Neil Alexander
2022-02-04Fix CPU spin from key change consumer when an invalid message is supplied ↵Neil Alexander
(#2146)
2022-02-04Version 0.6.1 (#2145)v0.6.1Neil Alexander
2022-02-04Remove sarama/saramajetstream dependencies (#2138)S7evinK
* Remove dependency on saramajetstream & sarama Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Remove internal.ContinualConsumer from federationapi * Remove internal.ContinualConsumer from syncapi * Remove internal.ContinualConsumer from keyserver * Move to new Prepare function * Remove saramajetstream & sarama dependency * Delete unneeded file * Remove duplicate import * Log error instead of silently irgnoring it * Move `OffsetNewest` and `OffsetOldest` into keyserver types, change them to be more sane values * Fix comments Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-02-04Remove roomserver input deadlines (#2144)Neil Alexander
It isn't really clear that the deadlines actually help in any way. Currently we can use up our 2 minutes doing something, run out of context time and then return an error which causes the transaction to rollback and forgetting everything we've done. If the message came to us from NATS then we probably will end up retrying just to be in the same situation. We'd be really a lot better if we just spent the time reconciling the problem in the first place, and then we're much less likely to need to fetch those missing auth or prev events in the future. Also includes matrix-org/gomatrixserverlib#287 so we don't wait so long for servers that are obviously dead.
2022-02-04Full roomserver input transactional isolation (#2141)Neil Alexander
* Add transaction to all database tables in roomserver, rename latest events updater to room updater, use room updater for all RS input * Better transaction management * Tweak order * Handle cases where the room does not exist * Other fixes * More tweaks * Fill some gaps * Fill in the gaps * good lord it gets worse * Don't roll back transactions when events rejected * Pass through errors properly * Fix bugs * Fix incorrect error check * Don't panic on nil txns * Tweaks * Hopefully fix panics for good in SQLite this time * Fix rollback * Minor bug fixes with latest event updater * Some review comments * Revert "Some review comments" This reverts commit 0caf8cf53e62c33f7b83c52e9df1d963871f751e. * Fix a couple of bugs * Clearer commit and rollback results * Remove unnecessary prepares
2022-02-02Fix panic from closing the input channel before the workers complete (it'll ↵Neil Alexander
get GC'd either way)
2022-02-02Use background contexts during federated join for clarity (#2134)Neil Alexander
* Use background contexts for clarity * Don't wait for the context to expire before trying to return * Actually we don't really need a goroutine here
2022-02-02Use pull consumers (#2140)Neil Alexander
* Pull consumers * Pull consumers * Only nuke consumers if they are push consumers * Clean up old consumers * Better error handling * Update comments
2022-02-02PerformInvite: bugfix and rejig control flow (#2137)kegsay
* PerformInvite: bugfix and rejig control flow Local clients would not be notified of invites to rooms Dendrite had already joined in all cases due to not returning an `api.OutputNewInviteEvent` for local invites. We now do this. This was an easy mistake to make due to the control flow of the function which doesn't handle the happy case at the end of the function and instead forks the function depending on if the invite was via federation or not. This has now been changed to handle the federated invite as if it were an error (in that we check it, do it and bail out) rather than outstay our welcome. This ends up with the local invite being the happy case, which now both sends an `InputRoomEvent` to the roomserver _and_ a `api.OutputNewInviteEvent` is returned. * Don't send invite pokes in PerformInvite * Move event ID into logger
2022-02-01Support CA certificates in CI (#2136)kegsay
* Support CA setting in generate-keys * Set DNS names correctly * Use generate-config -server not sed
2022-02-01Fix JetStream paths for P2P demo buildsNeil Alexander
2022-01-31More logging tweaksNeil Alexander