Commit Graph

65 Commits (8d1aea5b2ec5fb542282baa1daa76b6795f1ce0d)

Author SHA1 Message Date
Luke Barnard d3f9a3aeb5 Run eslint --fix
Fixing 1000s of lint issues. Some rules cannot be `--fix`ed but this goes some way to linting the entire codebase.
2017-10-11 17:56:17 +01:00
Richard van der Hoff 4998d1b359 Prepare for asynchronous e2e APIs
the js-sdk is making some of its APIs asynchronous, and adding an `initCrypto`
method which you have to call.

Particular methods we need to worry about are:

* `getStoredDevice`
* `getStoredDevicesForUser`
* `getEventSenderDeviceInfo`
* `isEventSenderVerified`
2017-07-18 23:47:36 +01:00
Richard van der Hoff a20ed2f632 Add some logging to track down flaky test
We had a test failure where apparently the MatrixClient failed to start
... let's try and figure out why.
2017-07-05 16:20:21 +01:00
David Baker 5d159c995d Merge branch 'master' into develop 2017-06-22 11:58:05 +01:00
Richard van der Hoff e9ab667d29 Use the web worker when clearing js-sdk stores
It turns out that Firefox doesn't let you use indexeddb from private tabs,
*unless* you are *also* in a webworker. We need to either consistently use it
or not use it - so let's use it.
2017-06-21 17:43:34 +01:00
David Baker a62f6d1094 Make the indexeddb worker script work again
Removed in 939f6d0798
2017-06-21 15:07:25 +01:00
David Baker e193fa5be5 Make the indexeddb worker script work again
Removed in 939f6d0798
2017-06-21 14:04:43 +01:00
Richard van der Hoff cd73139af5 Various logging cleanups
* don't just log errors without any context as to where they came from or what
   they mean
 * avoid the use of '%s' and multi-argument console.log because it looks awful
   under karma.
2017-06-20 17:38:02 +01:00
Richard van der Hoff 939f6d0798 Factor createMatrixClient out from MatrixClientPeg
... so that it can be used elsewhere.
2017-06-13 12:46:49 +01:00
Michael Telatynski 464863acd6 remove unused imports
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-02 21:35:55 +01:00
David Baker b78f654476 Add support for using indexeddb in a webworker 2017-04-06 11:13:39 +01:00
David Baker 9c4614e7ff Update for new IndexedDBStore interface 2017-03-31 14:55:33 +01:00
Kegan Dougal 658c34abf3 Change the name of the database
Full name is now `matrix-js-sdk:riot-web-sync`.
2017-02-21 15:44:57 +00:00
Kegan Dougal cca266c62c Review comments 2017-02-17 10:43:55 +00:00
Kegan Dougal c46f282139 Comments 2017-02-10 16:19:39 +00:00
Kegan Dougal 407bcf1bb9 Delete database on logout. DI a SyncAccumulator. Log uncaught errors 2017-02-10 14:22:54 +00:00
Kegan Dougal 300cd962e5 Add glue code to make react-sdk use indexedDB 2017-02-02 14:27:27 +00:00
David Baker 4942f4f35c Typo 2016-09-28 10:17:47 +01:00
David Baker c7ad9bfdad Add 'getHomeServerName' util to client peg 2016-09-27 19:38:10 +01:00
Matthew Hodgson 4aef352a5c update to use new API based on js-sdk PR input 2016-09-08 22:48:44 +01:00
Matthew Hodgson 27b3f5f6b1 create a global notif timeline set for each client 2016-09-08 03:02:26 +01:00
Richard van der Hoff df22768f1b Use server-generated deviceId 2016-08-12 07:31:15 +01:00
Richard van der Hoff e32c325863 Don't use MatrixClientPeg for temporary clients
Get rid of MatrixClientPeg.replaceUsingUrls, and instead create local,
temporary MatrixClients for the unauthed steps; we therefore only use
MatrixClientPeg for logged-in clients.
2016-08-11 16:23:03 +01:00
David Baker 92762eca74 Fix settings resetting on refresh
Don't clear localstorage when replacing the client: we clear it when logging out so this is just redundant, and since we now use replaceClient to unpickle a session from localstorage, this was blowing away all our setting on every refresh.

Also Move all of the localstorage code to Lifecycle (except device ID but this will probably be generated on the server soon anyway). We previously cleared localstorage on logout in Lifecycle so persist the session in Lifecycle.setLoggedIn() to be symmetrical.
2016-08-10 18:04:22 +01:00
Richard van der Hoff 3922f6a1b7 Move rehydration of MatrixClients from MatrixClientPeg to SessionLoader
This means that we don't create a spurious MatrixClient which is thrown away by
the SessionLoader (whilst still ensuring that the rehydrated matrixclient
follows the same code path as matrixclients created at other points in the
session load process).
2016-08-10 11:59:24 +01:00
David Baker b32a19a0f1 Comments 2016-08-03 17:23:09 +01:00
David Baker 0919e41469 Fix MatrixClientPeg.start()
Move import & use `this`
2016-08-03 16:45:23 +01:00
David Baker 009c768b72 Comma fail 2016-08-03 16:41:22 +01:00
David Baker 9bf45fb556 Add start wrapper in MatrixClientPeg
to handle the opts dictionary
2016-08-03 16:39:47 +01:00
David Baker d9a7d50a03 Add an interface for MatrixClientCreds
and make MatrixClientPeg functions use it consistently
2016-08-03 10:46:42 +01:00
David Baker 4825ab8fe7 No need to set options in WillStartClient
We can set them any time up to that point
2016-08-03 09:53:02 +01:00
David Baker 40834d188e Don't let pendingEventOrdering be changed 2016-08-02 18:58:18 +01:00
David Baker db9750a7e3 Call the logout API when we log out
Also try to refactor some of the login/logout code out of MatrixChat and into a separate Lifecycle.js. This still isn't great, but it at least gets some code out of MatrixClient.
2016-08-02 14:04:20 +01:00
David Baker cbf10bfff6 PR feedback
Reintroduce replaceClient so we're not calling replaceUsingAccessToken without access tokens which is a bit silly.
Fix bug from previous commit (pass isGuest through)
2016-07-25 16:28:28 +01:00
David Baker 587a86441f This may as wel go in createclient 2016-07-25 16:20:03 +01:00
David Baker ddbac8c73a More refactoring of MatrixClientPeg
Including getting rid of GuestAccess as it was basically doing nothing apart from remembering if we were a guest which may as well be done in the same place we save/restore everything else
2016-07-22 15:47:47 +01:00
David Baker b7e95b3883 Remove other guestAccess arg 2016-07-22 14:00:23 +01:00
David Baker ea5e021d8d Refactor MatrixClientPeg
Should be functionally identical
2016-07-21 17:57:55 +01:00
David Baker 46a2c74d71 Merge pull request #358 from matrix-org/rav/device_id_for_register
Set the device_id on pre-login MatrixClient
2016-07-21 13:15:39 +01:00
Richard van der Hoff e41df245c3 Set the device_id on pre-login MatrixClient
In order that device_id is set when we register a new user (or, for that
matter, when we register as a guest), we need to make sure that device_id is
set on the temporary MatrixClient which is created before the user is logged
in - ie, that created by replaceUsingUrls.

In order to achieve this, I've basically removed the distinction between
replaceUsingAccessToken and replaceUsingUrls. There is a side-effect in that
the temporary MatrixClient now gets an e2e sessionStore, but I don't think that
is a bad thing.
2016-07-20 20:20:10 +01:00
Aviral Dasgupta 769b3f0c2a Merge branch 'develop' into feature-autocomplete 2016-06-17 00:37:39 +05:30
Richard van der Hoff 3e44d7307f Fix eventListener warning
Bump up maxEventListeners on the MatrixClient to shut up the warning about
leaks.
2016-06-16 11:03:09 +01:00
Aviral Dasgupta 4bc8ec3e6d room, user, ddg autocomplete providers (wip) 2016-06-12 17:02:46 +05:30
Matthew Hodgson 893e338917 incorporate keganfeedback 2016-03-12 19:49:54 +00:00
Matthew Hodgson 0bb58dd60c brings back the functionality in login/register/screens that got lost in @kegsay's refactor. specifically:
1) custom HS/IS urls are now persisted in HTML5 local storage.  As a result, all the login components now distinguish between default HS/IS URLs and custom specified ones again. (
2) custom HS/IS urls are synchronised between the instances of ServerConfig found in the Login, Registration and Forgot Password screens.
3) username are persisted over changing homeserver (but not password, to stop accidentally leaking passwords to the wrong server)
4) correctly interpret a blank URL field as meaning the placeholder text
5) when toggling custom URLs on and off, remember what the custom values were, and use the default URLs if custom mode is not engaged

also, guest access now upholds custom HS/IS URLs found in local storage rather than being limited to the server config ()

also adds assorted comments and improved console debug and a few minor cosmetic changes to the login components.

this commit sponsored by VS27...
2016-03-06 14:33:36 -05:00
Kegan Dougal ef9b4ab1e6 Log when sessions are saved/restored/not found 2016-02-05 13:32:01 +00:00
Richard van der Hoff a4f4bb9e72 Convert RoomView to using a TimelineWindow
Instead of using the Room's active timeline directly, use a
TimelineWindow. This shouldn't (yet) have much effect, beyond maybe making
scrollback after a gappy sync slightly more efficient.

For now, I have disabled the 'restoreScrollState' functionality. This will be
reinstated once I land the link-to-event code.
2016-01-28 10:53:43 +00:00
Kegan Dougal c64f36c81b Merge branch 'develop' into kegan/guest-access 2016-01-07 13:21:06 +00:00
Matthew Hodgson 0772f50fab update copyright for 2016 2016-01-07 04:06:52 +00:00
Kegan Dougal 29587ec347 No longer persist guest room IDs. Replace with transient peeked room ID. 2016-01-06 17:33:00 +00:00