aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-21Docker Hub (#1053)Neil Alexander
* Initial Docker Hub test * Change upstream from for now * Working polylith setup and build tools * Some readme and other bits * Remove the readme for now * Add readme, rename a couple of things * COPY instead of ADD * Simplify component builds * Fix the docker-compose things * Build the base image again * Update readme, add .dockerignore * Indentation * Whitespace * Update images-push.sh * Update images-push.sh
2020-05-21Add tests due to https://github.com/matrix-org/sytest/pull/876Kegan Dougal
2020-05-20This now passes on sytest/developKegan Dougal
2020-05-20Use memberships to determine whether to reset latest events/state on room ↵Neil Alexander
join (#1047) * Track local/remote memberships, re-scope some input stuff * Check if we're in the room already before resetting latest events/state * Fix postgres, fix lint * Review comments
2020-05-20sytest: Add remaining backfill tests (#1052)Kegsay
One failed because of `null` instead of `[]` in HTTP responses. One failed because we hadn't implemented in-line filter limits!
2020-05-20sytest: Make 'Inbound federation can backfill events' pass (#1051)Kegsay
* sytest: Make 'Inbound federation can backfill events' pass This breaks 'Outbound federation can backfill events' because now we are returning the right number of events, which the previous test was relying on. Previously, /messages was backfilling the membership event, causing the test to pass. Now we are no longer backfilling the membership event due to the change in this commit, causing the test to fail. The test should instead be returning the membership event locally from synacpis database, but it doesn't do it fast enough, resulting in a no-op /sync response with a next_batch=s0_0 which will never pick up the local membership event when it rolls in. The test does attempt to retry, but doesn't take the new next_batch=s1_0 resulting in it missing from the /messages response. * Linting
2020-05-19Make "Outbound federation can backfill events" pass sytest (#1049)Kegsay
- Use a backfill limit of 100 regardless of what was asked. - Special case the create event for `StateIDsBeforeEvent` - Trim to the limit in `syncapi`
2020-05-19Bake in git commit into dendritejs binary (#1048)Kegsay
2020-05-19dendritejs: Persist ed25519 keys in localforage (#1046)Kegsay
2020-05-18bump go-http-js-libp2pKegan Dougal
2020-05-18Tweaks to latest events updater (#1045)Neil Alexander
* Comment out updaters a bit, add overwrite flag to latest events * Make sure we don't send fast-forwarded state changes over federation, start with empty set when overwriting * Remove redundant check for overwrite
2020-05-18Latest go-http-js-libp2pKegan Dougal
2020-05-18Add -api flag to monolith (#1044)Neil Alexander
* Add flag for enabling HTTP APIs in monolith mode * Flag -api * Only start HTTP APIs if needed
2020-05-15Only keep keys valid for 100 years rather than the heat death of the universeKegan Dougal
WASM builds really dislike thinking that far into the future, causing WASM to trap with "float unrepresentable in integer range", which corrupts the Go stack in wasm_exec which then leads to a segfault and the program exiting.
2020-05-15Fix a bug whereby backfilling could leak events across rooms (#1043)Kegsay
* Fix a bug whereby backfilling could leak events across rooms Caused by a faulty SQL query. With tests now. * comment
2020-05-15Don't prematurely stop trying to join using servers (#1041)Neil Alexander
* Don't prematurely stop trying to join using servers * Factor out performJoinUsingServer
2020-05-15Set canonical alias on room creation (#1042)Kegsay
2020-05-15Return user_id and stream_id in federated devices query (#1040)Neil Alexander
2020-05-15Prometheus metrics for LRU cache (#1039)Neil Alexander
* Add prom metrics for the in-memory LRU cache * Increase cache sizes
2020-05-15Add Range (#1037)Kegsay
* Add Range * Use Range
2020-05-15Implement key caching directly (#1038)Neil Alexander
* Use gomatrixserverlib key caching * Implement key caching wrapper * Add caching wrapper in BaseComponent * Review comments
2020-05-14Cleanup syncapi topology logic (#1035)Kegsay
* Cleanup syncapi topology logic * Variable renaming * comments
2020-05-14Update INSTALL.md, move docs (#1034)Neil Alexander
* Update INSTALL.md * Move some things * Clean up * Move some more things * Don't build all the things for the monolith * Update INSTALL.md * Nuke hooks
2020-05-14Finish merging syncserver.go (#1033)Kegsay
* Refactor all postgres tables; start work on sqlite * wip sqlite merges; database is locked errors to investigate and failing tests * Revert "wip sqlite merges; database is locked errors to investigate and failing tests" This reverts commit 26cbfc5b75ae2dc4fb31a838b917aa39d758f162. * convert current room state table * port over sqlite topology table * remove a few functions * remove more functions * Share more code * factor out completesync and a bit more * Remove remaining code
2020-05-14Fix some cases where accepting invites over federation doesn't work (#1028)Neil Alexander
* Handle cases where accepting invites doesn't work for historic rooms * Rewrite pairUpChanges * Review comments
2020-05-14Keyserver skeleton (#1032)Neil Alexander
* Keyserver skeleton * Indentation
2020-05-14Factor out account data and events table (#1031)Kegsay
* Factor out account data * Factor out events table and EDU cache * linting * fix npe
2020-05-13Initial syncapi storage refactor to share pq/sqlite code (#1030)Kegsay
* Initial syncapi storage refactor to share pq/sqlite code This goes down a different route than https://github.com/matrix-org/dendrite/pull/985 which tried to even reduce the boilerplate of `ExecContext` etc. The previous pattern fails badly when there are subtle differences in parameters and hence the shared boilerplate to read from `QueryContext` breaks. Rather than attacking it at that level, the main place where we want to reuse code is for the `syncserver.go` itself - the database implementation which has lots of complex logic. So instead, this commit: - Makes `invites_table.go` an interface. - Makes `SyncServerDatasource` use that interface - This means some functions are now identical for pq/sqlite, so factor them out to a temporary `shared.Database` struct which will grow until it replaces all of `SyncServerDatasource`. * Missing files
2020-05-13Spurious loggingKegan Dougal
2020-05-13Get profile content for join request again (#1027)Neil Alexander
2020-05-13Fix #1015 (#1026)Kegsay
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-05-13Reduce 500s (#1017)Neil Alexander
* Try to avoid returning 500s on /send * Don't return 500s from media API download requests * Don't 500 on context errors * Update sytest-whitelist * Fix lint, add comments
2020-05-13syncapi: Rename and split out tokens (#1025)Kegsay
* syncapi: Rename and split out tokens Previously we used the badly named `PaginationToken` which was used for both `/sync` and `/messages` requests. This quickly became confusing because named fields like `PDUPosition` meant different things depending on the token type. Instead, we now have two token types: `TopologyToken` and `StreamingToken`, both of which have fields which make more sense for their specific situations. Updated the codebase to use one or the other. `PaginationToken` still lives on as `syncToken`, an unexported type which both tokens rely on. This allows us to guarantee that the specific mappings of positions to a string remain solely under the control of the `types` package. This enables us to move high-level conceptual things like "decrement this topological token" to function calls e.g `TopologicalToken.Decrement()`. Currently broken because `/messages` seemingly used both stream and topological tokens, though I need to confirm this. * final tweaks/hacks * spurious logging * Review comments and linting
2020-05-13Enforce `mediaIDRegex` to be only valid `mediaIDCharacters` (#1020)Sid Karunaratne
Error messages indicate that: > mediaId must be a non-empty string using only characters in `mediaIDCharacters` However the regex used only required that some characters in the filename match the restriction, not that the entire filename does. This commit ensures that the filename must entirely fullfill the `mediaIDCharacters` restriction Signed-off-by: Sid Karunaratne <sid@karunaratne.net> Co-authored-by: Kegsay <kegan@matrix.org>
2020-05-12Update sytest-whitelistNeil Alexander
2020-05-12Implement /get_missing_events (#1022)Kegsay
* WIP get_missing_events work * More WIP get_missing_events work * First working /get_missing_events implementation Flakey currently due to racing between /sync and /send * Final tweaks * Remove log lines * Linting * go mod tidy * Clamp min depth to 0 * sort events by depth because sytest makes me sad Specifically I think it's https://github.com/matrix-org/sytest/blob/4172585c2521ec6d640b4b580080276da1ab5353/lib/SyTest/Federation/Client.pm#L265 to blame here.
2020-05-11Add PPROFLISTEN (#1019)Neil Alexander
* Add PPROFLISTEN env var * Direct logging to more useful places * Space
2020-05-11Prevent panic in membership updater (#1021)Neil Alexander
2020-05-11Update gomatrixserverlib for even more memory-efficient state res v2Neil Alexander
2020-05-11Update gomatrixserverlib for more memory-efficient state res v2Neil Alexander
2020-05-11Update sytest-whitelistNeil Alexander
2020-05-11Don't return 500s from media API download requestsNeil Alexander
2020-05-08Add registration_disabled to dendrite-config.yaml (#1013)Will Hunt
Missed this when first setting up my instance, and it feels important enough that it should be part of the sample config
2020-05-07Fix 'input to Unique() must be sorted' panicNeil Alexander
2020-05-07Direct messages (#1012)Neil Alexander
* Initial DM support, include invite event in stripped state for regular invites * Update go.mod, go.sum, test list
2020-05-07Improve federation sender performance, implement backoff and blacklisting, ↵Neil Alexander
fix up invites a bit (#1007) * Improve federation sender performance and behaviour, add backoff * Tweaks * Tweaks * Tweaks * Take copies of events before passing to destination queues * Don't accidentally drop queued messages * Don't take copies again * Tidy up a bit * Break out statistics (tracked component-wide), report success and failures from Perform actions * Fix comment, use atomic add * Improve logic a bit, don't block on wakeup, move idle check * Don't retry sucessful invites, don't dispatch sendEvent, sendInvite etc * Dedupe destinations, fix other bug hopefully * Dispatch sends again * Federation sender to ignore invites that are destined locally * Loopback invite events * Remodel a bit with channels * Linter * Only loopback invite event if we know the room * We should tell other resident servers about the invite if we know about the room * Correct invite signing * Fix invite loopback * Check HTTP response codes, push new invites to front of queue * Review comments
2020-05-06only send new events to RS; add tests for /state_ids and /event (#1011)Kegsay
* only send new events to RS; add tests for /state_ids and /event * Review comments: send in auth event order * Ignore order of state events for this test as RespState.Events is non-deterministic
2020-05-06Add tests around federationapi's txnReq (#1010)Kegsay
* Add necessary stubs for testing txnReq * Add basic tests
2020-05-05Fetch events by ID rather than use current state as this includes auth ↵Kegsay
events (#1009)
2020-05-05Remove debug lineKegan Dougal