Commit graph

524 commits

Author SHA1 Message Date
Brendan Abolivier
60d7f7f184
Fix comment for selectEvents 2018-12-13 09:27:55 +00:00
Brendan Abolivier
ad5b16a17b
Store and retrieve backward extremities to and from the database 2018-12-13 09:26:55 +00:00
Brendan Abolivier
570a76926d
Fix computing of topological pagination token 2018-12-12 11:09:35 +00:00
Brendan Abolivier
f600d520de
Limit the number of events returned by the database query when using topological tokens 2018-12-11 11:35:01 +00:00
Brendan Abolivier
b028a31f7f
Fix end position in case of backward ordering 2018-12-11 11:33:45 +00:00
Brendan Abolivier
955dd2c96d
Fix typo in structure name 2018-11-13 18:08:39 +00:00
Brendan Abolivier
4a3c9555b1
Refactor by implementing the messagesReq structure 2018-11-13 18:07:27 +00:00
Brendan Abolivier
38475d1489
Handle case where we get no events from the database and prevent end token < 1 2018-11-13 17:17:45 +00:00
Brendan Abolivier
89aeb21ef7
Implement the use of new pagination tokens in /messages
Also use them to store and retrieve events we got from backfilling
2018-11-12 18:45:41 +00:00
Brendan Abolivier
b205931819
Store room topology and use it in responses to sync requests 2018-11-12 16:42:13 +00:00
Brendan Abolivier
e1ee10c7bb
Implement new pagination tokens in sync requests/responses 2018-11-12 15:04:12 +00:00
Brendan Abolivier
9399760086
Add the PaginationToken type 2018-11-12 14:43:02 +00:00
Brendan Abolivier
a9d174c46f
Add ability to exclude an event from responses to sync requests 2018-11-12 12:33:13 +00:00
Brendan Abolivier
ca72f695d8 Merge branch 'master' into babolivier/cs-messages 2018-11-12 11:37:02 +00:00
Brendan Abolivier
2133e6bf59
Bump dependencies (#592)
* Bump dependencies

* Fix missing dependencies that were not previously fetched
2018-11-12 10:21:15 +00:00
Brendan Abolivier
87748a8860
Explicit TODO about saving events retrieved through backfill to the database 2018-11-09 09:39:56 +00:00
Brendan Abolivier
9d8c0d66f0
Fix cyclomatic complexity check 2018-11-09 09:33:49 +00:00
Brendan Abolivier
c3d25bd7cc
Implement /messages (with backfill when needed) 2018-11-08 21:39:13 +00:00
Brendan Abolivier
77dc37ce6f Merge branch 'master' into babolivier/cs-messages 2018-11-08 15:12:33 +00:00
Brendan Abolivier
8b0f60a470
Fill the prev_batch property in responses from /sync (#589)
* Fill the prev_batch property in responses from /sync

* Set prev_batch to 1 (first possible value in the sequence) if it's about to hit 0
2018-11-08 15:11:11 +00:00
Brendan Abolivier
4194ebf381
Retrieval of local messages
Rough outline with debug logging and no comment
2018-11-08 14:52:42 +00:00
Brendan Abolivier
4cb223f8dd
Export streamEvents
This makes it easier to handle stream positions at other places in the sync api component.
2018-11-08 12:20:44 +00:00
Brendan Abolivier
83c3c7e1db
Fix the ordering of events in a response to /sync (#588) 2018-11-07 19:12:23 +00:00
Brendan Abolivier
56058b9469
Implement the /backfill federation endpoint (#585)
* Implement the /backfill federation endpoint

* Make the BFS loop block common between QueryMissingEvents and QueryPreviousEvents

* Improve comments on the BFS loop block

* Optimisation: prevent unnecessary redefinitions/reallocations

* Add trailing slash at the end of the route for parity with synapse

* Replace QueryPreviousEvents with QueryBackfill

* Change the backfill response to comply with the specs and synapse's behaviour
2018-11-07 11:38:01 +00:00
Matthew Hodgson
daf57b19b7 make docker work on current codebase (#584) 2018-11-06 18:14:39 +00:00
Brendan Abolivier
8ff136e595
Fix interactive registration failing (#583)
* Fix interactive registration failing because of being confused with AS registration

* Fix AS registration tests

* Move AS registration handling to dedicated function and split the switch/case to avoid unnecessary condition

* Ignore handleRegistrationFlow() for gocyclo and add some doc/comments on the code
2018-11-06 14:40:37 +00:00
Zero King
1a82e6bc58 Add Go 1.11 to .travis.yml (#580) 2018-09-04 18:20:30 +01:00
Zero King
a0b38a6f2b Fix typo (#579) 2018-09-01 09:31:47 +01:00
krombel
b71d922a72 Propagate error with wrong ?ts= param back to client (#576)
* make MatrixError implement error interface

* let ParseTSParam return error when no int transmitted

* fix to high cyclo for SendEvent

* Move generateSendEvent below SendEvent

* Drop ParseIntParam() as it is used only in one place

* Parse ts param at the beginning of JoinRoom

to be able to abort right in the beginning and
to not parse the MatrixError to get an error response

* make ParseTSParam() return error instead of JSONResponse
2018-08-22 13:40:25 +01:00
Andrew Morgan
0b5ae4692e Make use of /users/{userID} in relevant APIs (#522)
* Query whether a room alias exists on app services

Signed-off-by: Andrew Morgan <andrewm@matrix.org>

* Query AS /alias/ API at a lower level

* Add support for querying /users/ on appservices

* Have endpoints query AS users if not found locally
2018-08-20 10:45:17 +01:00
Andrew Morgan
2382d363ab Include appservice namespace in username available check (#504)
Signed-off-by: Andrew Morgan <andrewm@matrix.org>
2018-08-20 10:23:01 +01:00
mohit kumar singh
d07a652d8e return same device as sent from client if it exists in db (#414)
Signed-off-by: mohit kumar singh <mohitkumarsingh907@gmail.com>
2018-08-20 10:22:06 +01:00
Anant Prakash
5d52863b9f
[Federation] Send typing events (#572)
* GetJoinedHosts from federation server db

* Add dummy api.OutputTypingEvent

* Add a typing server consumer to federation sender

* Update queue to support EDU events

* Update OutputTypingEvent format

* Use SendEDU in federation server, remove dummy/api

* Add helpful comments

* fix typo

* remove origin field

* Count EDUs in sendCounter
2018-08-10 20:56:57 +05:30
Andrew Morgan
bab4d1401f
AppServices: Implement /users/{userID} (#521)
* Add support for querying /users/ on appservices

* Fix copy/paste error
2018-08-10 07:47:14 -07:00
Andrew Morgan
609646c19b
Implement GET /rooms/{roomAlias} (#494)
* Query whether a room alias exists on app services

Signed-off-by: Andrew Morgan <andrewm@matrix.org>

* URL encode room alias before sending to AS

* Add /room/ to path

* Query AS /alias/ API at a lower level

* Don't verify self-signed AS certificates

* Don't skip cert validation on appservices, fix logging

* Separate req.WithContext

* Linting

* Do not warn when an AS room alias does not exist
2018-08-08 08:17:10 -07:00
Andrew Morgan
e05a31f4c2
Federation: Improve /query/directory endpoint (#525) 2018-08-07 06:41:50 -07:00
Anant Prakash
b11591fdd1
Fix up timestamp messaging (#570)
* Revert "implement AS timestamp massaging (#542)"

This reverts commit a56752f3f6.

* Update APIs to support ts

* refactor MakeJoin, make code consistent

* Keep one parameter per line
2018-08-06 18:39:25 +05:30
Anant Prakash
2c2200718a
Cleanup code in federationapi/routing (#571)
Signed-off-by: Anant Prakash <anantprakashjsr@gmail.com>
2018-08-06 18:37:29 +05:30
Anant Prakash
dc89e04e7d
Add whoami endpoint support (#434)
* Add whoami endpoint support

Signed-off-by: Anant Prakash <anantprakashjsr@gmail.com>

* Trim code, update against merged changes
2018-08-04 15:02:02 +05:30
Andrew Morgan
1176c1d574 Add detail to room alias name error message (#565) 2018-08-03 15:56:48 +01:00
Anant Prakash
1165b49da7
Implement Typing server (#567)
* update gomatrixserverlib

* Make removeUser public

* Implement api.TypingServerInputAPI

* Integrate the typing server component, create kafka topic

* Add typing server cmd for multiprocess dendrite
2018-08-02 22:52:44 +05:30
Anant Prakash
9cdd3a66e4
Add TypingCache to maintain a list of users typing (#559)
* Add typing cache

Signed-off-by: Anant Prakash <anantprakashjsr@gmail.com>

* Add tests for typingCache

* Make test stricter

* Handle cases where expireTime is updated

* Make the slice comparisons sturdy

* Use timers to call removeUser after timeout

* Add test for TypingCache.removeUser

Signed-Off-By: Matthias Kesler <krombel@krombel.de>

* Write deterministic test
2018-07-31 16:22:57 +05:30
Derek
f8ca2561cc removed outdated "flag" comments on clientapi membership storage (#566)
Signed-off-by: Derek Meer <derekmeer@protonmail.com>
2018-07-31 10:06:04 +01:00
Anant Prakash
2a2f42990a
Refactor string slice helper to common/test (#562)
* Refactor string slice helper to common/test

Signed-off-by: Anant Prakash <anantprakashjsr@gmail.com>

* Do not modify the given slice

* Add Unsorted in the function name
2018-07-26 22:04:39 +05:30
Anant Prakash
53a726fab1
Correct user/devices path (#557) 2018-07-25 18:28:10 +05:30
Anant Prakash
38965ef5e2
Support PUTing typing status in clientapi (#550)
* Add handler for typing events

* Add typing events producer

* Setup typing server component

* Send one event per API call
2018-07-24 20:19:49 +05:30
krombel
68131ca7a3 Handle AS with auth header (#548)
* Handle AS with auth header

* fix lint (gocyclo)
2018-07-23 06:40:35 -07:00
Andrew Morgan
d2ae425752
Generate SenderLocalpart AS user (#505)
* Generate sender_localpart user for each AS on startup

Signed-off-by: Andrew Morgan <andrewm@matrix.org>

* Clean up diff
2018-07-17 09:31:40 -07:00
Andrew Morgan
dbbfd26be7
Support inhibit_login registration option (#532)
* Support inhibit_login registration option

* Fix completeRegistration func definition

* Change InhibitLogin to a WeakBoolean
2018-07-17 08:57:20 -07:00
Andrew Morgan
a56752f3f6
implement AS timestamp massaging (#542) 2018-07-17 08:45:30 -07:00