Commit graph

957 commits

Author SHA1 Message Date
Neil Alexander 4cc1eaac5a Don't stop when there is work to be done 2020-07-01 10:41:25 +01:00
Neil Alexander a9aa3c263b Count PDUs to make more resilient 2020-07-01 10:32:49 +01:00
Neil Alexander ead6ee69c3 Reduce unnecessary retries 2020-07-01 10:25:35 +01:00
Neil Alexander c4571c9cdd Don't send empty transactions 2020-07-01 10:19:29 +01:00
Neil Alexander cef07c4e4e Clean up transaction properly 2020-07-01 10:16:42 +01:00
Neil Alexander 3419a7450b Shuffle things around a bit 2020-07-01 10:12:14 +01:00
Neil Alexander eaa7a679ac Review comments 2020-07-01 09:48:48 +01:00
Neil Alexander b41308bd51 remove unused types 2020-06-30 16:16:53 +01:00
Neil Alexander 18245f224a Fix SQLite 2020-06-30 16:14:57 +01:00
Neil Alexander c8ee57ba07 Rehydrate more opportunistically 2020-06-30 15:43:15 +01:00
Neil Alexander b4bbefd523 Clean up 2020-06-30 15:36:42 +01:00
Neil Alexander 61ff558fef Fix query, use transactions in postgres 2020-06-30 15:11:51 +01:00
Neil Alexander ebaa0cf5d4 Debug logging 2020-06-30 15:05:08 +01:00
Neil Alexander bab00192c2 Try to tidy up JSON 2020-06-30 14:48:13 +01:00
Neil Alexander 51dba37d7a Don't block if there are PDUs waiting 2020-06-30 14:32:05 +01:00
Neil Alexander 5082179ce3 Don't error on now rows 2020-06-30 14:19:49 +01:00
Neil Alexander 2caaaf7a68 Marshal headered event 2020-06-30 14:14:38 +01:00
Neil Alexander f31be26df4 Use functions 2020-06-30 14:12:38 +01:00
Neil Alexander a6aaa5aa52 Use RETURNING because LastInsertID is not supported by postgres 2020-06-30 14:10:24 +01:00
Neil Alexander 693928396d Merge branch 'master' into neilalexander/persistentqueues 2020-06-30 14:05:09 +01:00
Neil Alexander 56e3d51fa4 Fix table name 2020-06-30 13:35:11 +01:00
Kegsay 6f49758b90
Remove membership table from account DB (#1172)
* Remove membership table from account DB

And make code which needs that data use the currentstate server

* Unbreak tests; use a membership enum for space
2020-06-30 13:34:59 +01:00
Neil Alexander 4f206eb478 Fix index 2020-06-30 13:34:29 +01:00
Neil Alexander 0ac6c802fb Fix table name 2020-06-30 13:33:41 +01:00
Neil Alexander 2c3540d82b Duplicate postgres code into sqlite for now just to stop build errors, will fix SQLite soon 2020-06-30 13:31:56 +01:00
Neil Alexander 339ea3d711 Put things into database (postgres for now) 2020-06-30 13:27:49 +01:00
Kegsay ca5bbffd8d
Add a new component: currentstateserver (#1171)
* Add a new component: currentstateserver

- Add a skeleton for it, with databases and a single query method.
- Add integration tests for it.
- Add listen/address fields in the config (breaking as this will force people to specify this to validate)

Not currently hooked up to anything yet.

* Unbreak config tests

* Add current_state to sample config

* comments
2020-06-30 10:37:21 +01:00
Kegan Dougal 3a18b7fc78 Update awsy list 2020-06-30 10:26:26 +01:00
Neil Alexander b6ef3996f2 Update index for event ID and server name 2020-06-29 15:48:13 +01:00
Neil Alexander a66e2084e8 Merge branch 'master' into neilalexander/persistentqueues 2020-06-29 15:29:46 +01:00
Neil Alexander e7997c1e97 Initial work on persistent queues 2020-06-29 15:29:28 +01:00
Neil Alexander 4cf45d1ce9
Don't include current state in processEventWithMissingState (#1126)
* Don't include current state in processEventWithMissingState

* Remove lookupCurrentState as not needed

Co-authored-by: Kegsay <kegan@matrix.org>
2020-06-29 14:39:21 +01:00
Kegsay 1ad7219e4b
Implement /sync limited and read timeline limit from stored filters (#1168)
* Move filter table to syncapi where it is used

* Implement /sync `limited` and read timeline limit from stored filters

We now fully handle `room.timeline.limit` filters (in-line + stored) and
return the right value for `limited` syncs.

* Update whitelist

* Default to the default timeline limit if it's unset, also strip the extra event correctly

* Update whitelist
2020-06-26 15:34:41 +01:00
Kegsay 164057a3be
Honour event size limits and return 413 (#1167) 2020-06-26 12:51:54 +01:00
Kegan Dougal 9592d53364 Fix div 0 error and add new tests to list 2020-06-26 11:34:25 +01:00
Kegsay 4897beabee
Finish implementing retiring invites (#1166)
* Pass retired invites to the syncapi with the event ID of the invite

* Implement retire invite streaming

* Update whitelist
2020-06-26 11:07:52 +01:00
Kegan Dougal c1d2382e6d Reject non-numeric ports (done in GMSL) 2020-06-25 18:05:41 +01:00
Kegsay 7a8282fccf
Handle invite v1 (#1165)
* Implement invite v1 for sytest mainly

* Bump gmsl version which falls back to invite v1 if v2 404s

* Update whitelist
2020-06-25 17:07:40 +01:00
Kegan Dougal 67f7a53f12 Add missing typing test 2020-06-25 15:06:46 +01:00
Kegsay 43cddfe00f
Return remote errors from FS.PerformJoin (#1164)
* Return remote errors from FS.PerformJoin

Follows the same pattern as PerformJoin on roomserver (no error return).

Also return the right format for incompatible room version errors.

Makes a bunch of tests pass!

* Handle network errors better when returning remote HTTP errors

* Linting

* Fix tests

* Update whitelist, pass network errors through in API=1 mode
2020-06-25 15:04:48 +01:00
Ashley Nelson c2d34422d6
Remove trailing slash in client api proxy (#1163)
Signed-off-by: Ashley Nelson <amn@fantashley.com>
2020-06-25 12:27:09 +01:00
Kegsay 46de400aa0
Hopefully fix databased is locked errors on sqlite account creation (#1162) 2020-06-24 20:46:28 +01:00
Kegsay e560619f76
Refactor SendMembership - make ban test pass (#1160)
* Refactor SendMembership - make ban test pass

* Only check invite auth events for local invites
2020-06-24 18:19:54 +01:00
Kegsay a06d0921c9
Make same membership transitions 403, add sytests (#1161)
* Make same membership transitions 403, add sytests

* Update blacklist
2020-06-24 18:19:14 +01:00
Kegsay 002fe05a20
Add PerformInvite and refactor how errors get handled (#1158)
* Add PerformInvite and refactor how errors get handled

- Rename `JoinError` to `PerformError`
- Remove `error` from the API function signature entirely. This forces
  errors to be bundled into `PerformError` which makes it easier for callers
  to detect and handle errors. On network errors, HTTP clients will make a
  `PerformError`.

* Unbreak everything; thanks Go!

* Send back JSONResponse according to the PerformError

* Update federation invite code too
2020-06-24 15:06:14 +01:00
Kegan Dougal ebaaf65c54 This doesn't pass 2020-06-24 13:40:50 +01:00
Kegan Dougal c72d23c8eb Update whitelist 2020-06-24 10:28:03 +01:00
Kegsay 0577bfca55
Pass join errors through internal API boundaries (#1157)
* Pass join errors through internal API boundaries

Required for certain invite sytests. We will need to think of a
better way of handling this going forwards.

* Include m.room.avatar in stripped state; handle trailing slashes when GETing state events

* Update whitelist

* Update whitelist
2020-06-24 09:59:59 +01:00
Kegan Dougal 1f93427ed9 Linting 2020-06-23 18:44:34 +01:00
Kegan Dougal 81beab8002 Add instrumented main for coverage 2020-06-23 18:32:22 +01:00