Commit Graph

606 Commits

Author SHA1 Message Date
Erik Johnston 9ccccd4874 When setting display name more graciously handle failures to update room state. 2015-03-06 16:24:05 +00:00
Erik Johnston 130df8fb01 Add some randomness to the user specified timeout on event streams to mitigate against thundering herds problems 2015-03-06 10:25:36 +00:00
Kegsay 8ad024ea80 Merge pull request #93 from matrix-org/application-services-exclusive
Application services exclusive flag support
2015-03-02 14:56:32 +00:00
Erik Johnston 0a036944bd Merge branch 'develop' of github.com:matrix-org/synapse into batched_get_pdu 2015-03-02 13:53:30 +00:00
Kegan Dougal 58ff066064 Implement exclusive namespace checks. 2015-02-27 13:51:41 +00:00
Kegan Dougal dcec7175dc Finish impl to get new events for AS. ASes should now be able to poll /events 2015-02-26 16:23:01 +00:00
Kegan Dougal 2d20466f9a Add stub functions and work out execution flow to implement AS event stream polling. 2015-02-25 15:00:59 +00:00
David Baker 443ba4eecc %s for strings otherwise you end up sending 'u"foo"' 2015-02-24 15:00:12 +00:00
Erik Johnston e25e0f4da9 Merge branch 'develop' of github.com:matrix-org/synapse into batched_get_pdu 2015-02-23 14:36:00 +00:00
Erik Johnston db215b7e00 Implement and use new batched get missing pdu 2015-02-23 13:58:02 +00:00
Erik Johnston 2bafeca270 Add missing comma so that it generates a dict and not a set 2015-02-20 14:08:42 +00:00
Erik Johnston 0ac2a79faa Initial stab at implementing a batched get_missing_pdus request 2015-02-19 17:24:14 +00:00
Erik Johnston fa6c93bd26 Merge branch 'consumeErrors' of github.com:matrix-org/synapse into develop 2015-02-17 15:18:17 +00:00
Erik Johnston 47281f8fa4 Change some debug logging to info 2015-02-17 13:14:11 +00:00
Erik Johnston c2b1dbd84c We do want to consumeError 2015-02-17 11:11:11 +00:00
Erik Johnston 72a4de2ce6 Use consumeErrors=True on all DeferredLists.
This is so that the DeferredLists actually consume the error instead of
propogating down the non-existent errback chain. This should reduce the
number of unhandled errors we are seeing.
2015-02-17 10:07:01 +00:00
Erik Johnston 8a59915d7d Merge branch 'hotfixes-v0.7.0f' of github.com:matrix-org/synapse into develop 2015-02-16 09:47:22 +00:00
Erik Johnston b99a33f283 resolve_events expect lists, not dicts 2015-02-15 20:20:51 +00:00
Erik Johnston 650dc7f0f9 Merge branch 'master' of github.com:matrix-org/synapse into develop 2015-02-13 15:46:42 +00:00
Erik Johnston b11a6e1c3c Fix wrong variable name 2015-02-13 15:37:18 +00:00
Mark Haines 0d872f5aa6 Merge pull request #50 from matrix-org/application-services
Application Services
2015-02-13 15:06:14 +00:00
Erik Johnston e441c10a73 pyflakes 2015-02-13 14:23:39 +00:00
Erik Johnston 8c652a2b5f When we see a difference in current state, actually use state conflict resolution algorithm 2015-02-13 14:20:05 +00:00
Paul "LeoNerd" Evans 93d07c87dc Reindent code to be less human-readable to keep pep8 from complaining 2015-02-12 19:19:37 +00:00
Paul "LeoNerd" Evans 5f6e6530d0 Appease pyflakes 2015-02-12 19:15:23 +00:00
Paul "LeoNerd" Evans 29805213d1 Can now remove the FIXME too 2015-02-12 19:13:21 +00:00
Paul "LeoNerd" Evans 860b1b4841 Only attempt to fetch presence state of JOINed members in room initialSync (SYN-202) 2015-02-12 19:13:21 +00:00
Erik Johnston 76935078d1 Remove more debug logging 2015-02-11 16:51:22 +00:00
Erik Johnston ed877d6585 Remove debug logging 2015-02-11 16:50:46 +00:00
Erik Johnston ddb816cf60 Don't unfreeze when using FreezeEvent.get_dict, as we are using a JSONEncoder that understands FrozenDict 2015-02-11 15:44:28 +00:00
Kegan Dougal fd40d992ad PEP8-ify 2015-02-11 10:41:33 +00:00
Kegan Dougal c7783d6fee Notify ASes for events sent by other users in a room which an AS user is a part of. 2015-02-11 10:36:08 +00:00
Kegan Dougal 9978c5c103 Merge branch 'develop' into application-services 2015-02-11 10:03:24 +00:00
Mark Haines 84a769cdb7 Fix code-style 2015-02-10 17:58:36 +00:00
Mark Haines b085fac735 Code-style fixes 2015-02-10 16:30:48 +00:00
Erik Johnston b90d377af4 Merge branch 'release-v0.6.2' of github.com:matrix-org/synapse into develop 2015-02-10 10:33:35 +00:00
Erik Johnston d94f682a4c During room intial sync, only calculate current state once. 2015-02-09 17:41:29 +00:00
Kegan Dougal 53557fc532 Merge branch 'develop' into application-services 2015-02-09 15:20:56 +00:00
Kegan Dougal f7cac2f7b6 Fix bugs so lazy room joining works as intended. 2015-02-09 15:01:28 +00:00
Kegan Dougal ac3183caaa Register a user account for the AS when the AS registers. Add 'sender' column to AS table. 2015-02-09 12:03:37 +00:00
Matthew Hodgson 37b6b880ef don't give up if we can't create default avatars during tests 2015-02-07 21:24:08 +00:00
Matthew Hodgson 582019f870 ...and here's the actual impl. git fail. 2015-02-07 13:32:14 +00:00
Kegan Dougal 73a680b2a8 Add errcodes for appservice registrations. 2015-02-06 17:10:04 +00:00
Mark Haines 20db147ef3 SYN-258: get_recent_events_for_room only accepts stream tokens, convert the topological token to a stream token before passing it to get_recent_events_for_room 2015-02-06 16:01:04 +00:00
Mark Haines 55a186485c SYN-258: get_recent_events_for_room only accepts stream tokens, convert the topological token to a stream token before passing it to get_recent_events_for_room 2015-02-06 15:58:40 +00:00
Erik Johnston cc0532a4bf Explicitly list the RejectedReasons that we can prove 2015-02-06 15:16:26 +00:00
Erik Johnston e890ce223c Don't query auth if the only difference is events that were rejected due to auth. 2015-02-06 14:16:50 +00:00
Erik Johnston c78b5fb1f1 Make seen_ids a set 2015-02-06 13:52:16 +00:00
Kegan Dougal 0995810273 Pyflakes: unused variable. 2015-02-06 11:45:19 +00:00
Kegan Dougal c3ae8def75 Grant ASes the ability to delete aliases in their own namespace. 2015-02-06 11:32:07 +00:00
Kegan Dougal e426df8e10 Grant ASes the ability to create alias in their own namespace.
Add a new errcode type M_EXCLUSIVE when users try to create aliases inside
AS namespaces, and when ASes try to create aliases outside their own
namespace.
2015-02-06 10:57:14 +00:00
Erik Johnston 3737329d9b Handle the fact the list.remove raises if element doesn't exist 2015-02-06 10:53:18 +00:00
Kegan Dougal 0227618d3c Add m.login.application_service registration procedure.
This allows known application services to register any user ID under their
own user namespace(s).
2015-02-05 17:29:27 +00:00
Kegan Dougal 11e6b3d18b Dependency inject ApplicationServiceApi when creating ApplicationServicesHandler. 2015-02-05 17:04:59 +00:00
Kegan Dougal cab4c73088 Prevent user IDs in AS namespaces being created/deleted by humans. 2015-02-05 16:46:56 +00:00
Kegan Dougal e9484d6a95 Prevent aliases in AS namespaces being created/deleted by users. Check with ASes when queried for room aliases via federation. 2015-02-05 16:29:56 +00:00
Kegan Dougal 951690e54d Merge branch 'develop' into application-services 2015-02-05 14:28:03 +00:00
Kegan Dougal c71456117d Fix user query checks. HS>AS pushing now works. 2015-02-05 14:17:08 +00:00
Erik Johnston 8f5b858a1b Merge branch 'develop' of github.com:matrix-org/synapse into federation_client_retries 2015-02-05 13:50:28 +00:00
Erik Johnston e1515c3e91 Pass through list of room hosts from room alias query to federation so that it can retry against different room hosts 2015-02-05 13:44:42 +00:00
Kegan Dougal 51d63ac329 Glue AS work to general event notifications. Add more exception handling when poking ASes. 2015-02-05 13:19:46 +00:00
Erik Johnston 26a041541b SYN-202: Log as WARN the 404 'Presence information not visible' errors instead of as ERROR since they were spamming the logs 2015-02-05 13:17:05 +00:00
Kegan Dougal b932600653 Add unknown room alias check. Call it from directory_handler.get_association 2015-02-05 11:47:11 +00:00
Kegan Dougal f0c730252f Add unknown user ID check. Use store.get_aliases_for_room(room_id) when searching for services by alias. 2015-02-05 11:25:32 +00:00
Kegan Dougal 27091f146a Add hs_token column and generate a different token f.e application service. 2015-02-05 10:08:12 +00:00
Kegan Dougal a1a4960baf Impl push_bulk function 2015-02-05 09:43:22 +00:00
Kegan Dougal 96d4bf9012 Modify API for SimpleHttpClient.get_json and update usages.
Previously, this would only return the HTTP body as JSON, and discard other
response information (e.g. the HTTP response code). This has now been changed
to throw a CodeMessageException on a non-2xx response, with the response code
and body, which can then be parsed as JSON.

Affected modules include:
 - Registration/Login (when using an email for IS auth)
2015-02-04 17:07:31 +00:00
Kegan Dougal aa8cce58bf Add query_user/alias APIs. 2015-02-04 16:44:53 +00:00
Erik Johnston d45e2302ed Merge branch 'signature_failures' of github.com:matrix-org/synapse into federation_client_retries 2015-02-04 16:30:15 +00:00
Erik Johnston ae46f10fc5 Apply sanity to the transport client interface. Convert 'make_join' and 'send_join' to accept iterables of destinations 2015-02-04 16:28:12 +00:00
Erik Johnston 95e2d2d36d When returning lists of servers from alias lookups, put the current server first in the list 2015-02-04 15:02:23 +00:00
Erik Johnston 650e32d455 Change context.auth_events to what the auth_events would be bases on context.current_state, rather than based on the auth_events from the event. 2015-02-04 14:06:46 +00:00
Kegan Dougal 525a218b2b Begin to add unit tests for appservice glue and regex testing. 2015-02-04 12:24:20 +00:00
Kegan Dougal 17753f0c20 Add stub ApplicationServiceApi and glue it with the handler. 2015-02-04 11:19:18 +00:00
Erik Johnston c0462dbf15 Rearrange persist_event so that do all the queries that need to be done before returning early if we have already persisted that event. 2015-02-04 10:16:51 +00:00
Erik Johnston 7dd1c5c542 Neaten the handling of state and auth_chain up a bit 2015-02-03 16:12:04 +00:00
Kegan Dougal 94a5db9f4d Add appservice package and move ApplicationService into it. 2015-02-03 14:44:16 +00:00
Erik Johnston 6efd4d1649 Don't completely die if get auth_chain or querying auth_chain requests fail 2015-02-03 13:57:54 +00:00
Erik Johnston 77a076bd25 Set combinations is | and not + 2015-02-03 13:35:17 +00:00
Kegan Dougal f2c039bfb9 Implement restricted namespace checks. Begin fleshing out the main hook for notifying application services. 2015-02-03 13:29:27 +00:00
Erik Johnston fed29251d7 Spelling 2015-02-03 13:23:58 +00:00
Kegan Dougal a060b47b13 Add namespace constants. Add restrict_to option to limit namespace checks. 2015-02-03 13:17:28 +00:00
Kegan Dougal 197f3ea4ba Implement regex checks for app services.
Expose handler.get_services_for_event which manages the checks for all
services.
2015-02-03 11:26:33 +00:00
Erik Johnston 06c34bfbae Give exception better message 2015-02-03 11:23:44 +00:00
Erik Johnston 4ff2273b30 Add FIXME note. 2015-02-03 11:23:26 +00:00
Erik Johnston 51969f9e5f Return rejected events if asked for it over federation. 2015-02-03 10:40:14 +00:00
Erik Johnston e7ca813dd4 Try to ensure we don't persist an event we have already persisted. In persist_event check if we already have the event, if so then update instead of replacing so that we don't cause a bump of the stream_ordering. 2015-02-03 10:39:41 +00:00
Kegan Dougal 1a2de0c5fe Implement txns for AS (un)registration. 2015-02-02 17:39:41 +00:00
Kegan Dougal c059c9fea5 Merge branch 'develop' into application-services
Conflicts:
	synapse/handlers/__init__.py
	synapse/storage/__init__.py
2015-02-02 15:57:59 +00:00
Erik Johnston 4c0da49d7c Resign events when we return them via /query_auth/ 2015-01-30 22:53:13 +00:00
Mark Haines 0b1cc7cc0b Return empty list rather than None when there are no emphemeral events for a room 2015-01-30 16:56:13 +00:00
Erik Johnston 2cd29dbdd9 Fix bug where accepting invite over federation didn't work. Add logging. 2015-01-30 16:51:58 +00:00
Erik Johnston 7d897f5bfc Merge pull request #43 from matrix-org/rejections
Rejections
2015-01-30 16:11:14 +00:00
Erik Johnston b724a809c4 Only auth_events with event if event in event.auth_events 2015-01-30 15:57:53 +00:00
Mark Haines 017dfaef4c Add doc string for __nonzero__ overrides for sync results, raise not implemented if the client attempts to do a gapless sync 2015-01-30 15:52:05 +00:00
Mark Haines 8fe39a0311 Check if the user has joined the room between incremental syncs 2015-01-30 13:38:34 +00:00
Erik Johnston a70a801184 Fix bug where we superfluously asked for current state. Change API of /query_auth/ so that we don't duplicate events in the response. 2015-01-30 13:34:01 +00:00
Mark Haines 4a67834bc8 Pass client info to the sync_config 2015-01-30 11:50:15 +00:00
Mark Haines 8498d348d8 Fix token formatting 2015-01-30 11:42:09 +00:00
Mark Haines e97de6d96a Filter the recent events before applying the limit when doing an initial sync 2015-01-30 11:35:20 +00:00
Mark Haines 22dd1cde2d Filter the recent events before applying the limit when doing an incremental sync with a gap 2015-01-30 11:32:35 +00:00
Erik Johnston 2ebf795c0a Merge branch 'develop' of github.com:matrix-org/synapse into rejections
Conflicts:
	synapse/storage/__init__.py
	synapse/storage/schema/delta/v12.sql
2015-01-30 11:10:37 +00:00
Erik Johnston 0c2d245fdf Update the current state of an event if we update auth events. 2015-01-30 11:08:52 +00:00
Erik Johnston c1d860870b Fix regression where we no longer correctly handled the case of gaps in our event graph 2015-01-30 10:48:47 +00:00
Mark Haines ece828a7b7 Update todo for the filtering on sync 2015-01-29 18:15:24 +00:00
Erik Johnston 78015948a7 Initial implementation of auth conflict resolution 2015-01-29 16:52:33 +00:00
Mark Haines 4ad45f2582 Fix indent 2015-01-29 16:41:49 +00:00
Mark Haines 722b65f461 Move typing notifs to an "emphermal" event list on the room object 2015-01-29 16:41:21 +00:00
Mark Haines cc42d3f907 Fix check for empty room update 2015-01-29 16:27:38 +00:00
Mark Haines 4d9dd9bdc0 Fix v2 initial sync 2015-01-29 16:23:03 +00:00
Mark Haines e016f4043b Use get_room_events_stream to get changes to the rooms if the number of changes is small 2015-01-29 14:40:28 +00:00
Mark Haines e3e72b8c5c Remove typing TODO 2015-01-29 03:35:25 +00:00
Mark Haines 3dbce6f4a5 Add typing notifications to sync 2015-01-29 03:33:51 +00:00
Mark Haines 9c61556504 Merge branch 'develop' into client_v2_sync 2015-01-28 17:29:30 +00:00
Mark Haines 26c8fff19e Merge pull request #36 from matrix-org/device_id_from_access_token
Extract the device id and token id from the access token when autheniticating users
2015-01-28 17:19:28 +00:00
Mark Haines 388581e087 Extract the id token of the token when authing users, include the token and device_id in the internal meta data for the event along with the transaction id when sending events 2015-01-28 16:58:23 +00:00
Erik Johnston 0ef5bfd6a9 Start implementing auth conflict res 2015-01-28 16:16:53 +00:00
David Baker 6840e7cece Merge branch 'master' into develop 2015-01-28 16:03:35 +00:00
David Baker c291a4d522 Merge branch 'develop' into pushers
Conflicts:
	synapse/handlers/events.py
	synapse/server.py
2015-01-28 12:51:05 +00:00
Kegan Dougal 42876969b9 Add basic application_services SQL, and hook up parts of the appservice store to read from it. 2015-01-28 11:59:38 +00:00
David Baker 273b12729b Reset badge count to zero when last active time is bumped 2015-01-28 11:55:49 +00:00
David Baker e32ded7b3e Add matrix.org as a trusted ID server because it's now passed through on ports 80/443 and the web client defaults to that now. Fixes email validation (including signing up with an email address). 2015-01-28 10:09:54 +00:00
Mark Haines e020574d65 Fix Formatting 2015-01-27 20:19:36 +00:00
Mark Haines b19cf6a105 Wait for events if the incremental sync is empty and a timeout is given 2015-01-27 20:09:52 +00:00
Kegan Dougal fbeaeb8689 Log when ASes are registered/unregistered. 2015-01-27 17:34:40 +00:00
Kegan Dougal ec3719b583 Use ApplicationService when registering. 2015-01-27 17:15:06 +00:00
Kegan Dougal 92171f9dd1 Add stub methods, TODOs and docstrings for application services. 2015-01-27 16:53:59 +00:00
Mark Haines a56008842b Start implementing incremental initial sync 2015-01-27 16:24:22 +00:00
David Baker f7c4daa8f9 Oops, remove debugging 2015-01-27 16:08:47 +00:00
David Baker 5eacaeb4a7 or of course we could just return the deferred 2015-01-27 16:05:23 +00:00
David Baker eba89f093f Need a defer.inlineCallbacks here as we yield in it: otherwise nothing in the cb gets executed. 2015-01-27 16:00:07 +00:00
David Baker 1d77969124 Unbreak bad presence merge - don't add these blocks together with an and: they're different things. 2015-01-27 15:58:27 +00:00
Kegan Dougal 51449e0665 Add appservice handler and store. Glue together rest > handler > store. 2015-01-27 15:50:28 +00:00
Mark Haines 436513068d Start implementing the non-incremental sync portion of the v2 /sync API 2015-01-26 18:53:31 +00:00
Mark Haines 3186c5bdbc Merge branch 'develop' into client_v2_sync 2015-01-26 16:32:40 +00:00
Mark Haines 7f6f3f9d62 Pass the current time to serialize event, rather than passing an
HS and getting a clock from it and calling time_msec on the clock.
Remove the serialize_event method from the HS since it is no longer
needed.
2015-01-26 16:11:28 +00:00
Mark Haines 0cfb4591a7 Add handler for /sync API 2015-01-26 15:46:31 +00:00
Mark Haines ada711504e Replace hs.parse_roomalias with RoomAlias.from_string 2015-01-23 13:21:58 +00:00
Mark Haines 1c06c48ce2 Replace hs.parse_roomid with RoomID.from_string 2015-01-23 11:55:12 +00:00
Mark Haines 5759bec43c Replace hs.parse_userid with UserID.from_string 2015-01-23 11:47:15 +00:00
David Baker 5c6189ea3e Merge branch 'develop' into pushers
Conflicts:
	synapse/rest/__init__.py
2015-01-22 17:46:16 +00:00
Mark Haines 5fed042640 Finish renaming "context" to "room_id" in federation codebase 2015-01-16 19:01:03 +00:00
Mark Haines 2bdee98269 Remove temporary debug logging that was accidentally committed 2015-01-16 19:00:40 +00:00
David Baker e3e2fc3255 Don't make the pushers' event streams cause people to appear online 2015-01-15 16:17:21 +00:00
Paul "LeoNerd" Evans c2e7c84e58 Don't try to cancel already-expired timers - SYN-230 2015-01-13 16:58:36 +00:00
Paul "LeoNerd" Evans 02ffbb20d0 Use float rather than integer divisions to turn msec into sec - so timeouts under 1000msec will actually work 2015-01-12 19:09:14 +00:00
Paul "LeoNerd" Evans 67d8305aea Make typing notification timeouts print a (debug) logging message 2015-01-12 18:22:00 +00:00
Kegan Dougal b5924cae04 Add raw query param for scrollback. 2015-01-08 14:37:55 +00:00
Kegan Dougal edb557b2ad Return the raw federation event rather than adding extra keys for federation data. 2015-01-08 14:28:08 +00:00
Erik Johnston 5940ec993b Add missing continuation indent. 2015-01-08 13:59:29 +00:00