1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00
Commit Graph

2159 Commits

Author SHA1 Message Date
Richard van der Hoff
e52985e082 Olm session creation async 2017-08-10 15:01:56 +01:00
Richard van der Hoff
7d2bc12bb7 Make OlmDevice key generation async
* OlmDevice.generateOneTimeKeys becomes async
* Stash maxOneTimeKeys at init so that maxNumberOfOneTimeKeys can remain sync
2017-08-10 15:01:56 +01:00
Richard van der Hoff
a5f397b26d OlmDevice.oneTimeKeys async
* OlmDevice.getOneTimeKeys
* OlmDevice.markKeysAsPublished
2017-08-10 15:01:56 +01:00
Richard van der Hoff
5b93d5210e Make OlmDevice.sign async 2017-08-10 15:01:56 +01:00
Richard van der Hoff
e943a6e09c Make OlmDevice olmSession methods asynchronous
* OlmDevice.encryptMessage
* OlmDevice.decryptMessage
* OlmDevice.matchesSession
2017-08-10 15:01:56 +01:00
Richard van der Hoff
8f527a6212 make session tracking methods in OlmDevice async
* OlmDevice.getSessionIdsForDevice
* OlmDevice.getSessionIdForDevice
* OlmDevice.getSessionInfoForDevice
2017-08-10 15:01:56 +01:00
Richard van der Hoff
f2f8ad6b65 Make OlmDevice initialisation asynchronous
Add an asynchronous `init` method to OlmDevice which initialises the OlmAccount.
2017-08-10 15:01:56 +01:00
Richard van der Hoff
c870930bc0 Add delays to tests to wait for things to decrypt
Prepare for some refactoring which will add an extra tick to decryption by
adding some `awaitDecryption` calls in the integration tests.
2017-08-10 15:01:56 +01:00
Richard van der Hoff
92a75aaa08 Merge pull request #521 from matrix-org/rav/async_crypto/olmlib
Make bits of `olmlib` asynchronous
2017-08-10 11:07:42 +01:00
Richard van der Hoff
906bf88450 Merge remote-tracking branch 'origin/develop' into rav/async_crypto/olmlib 2017-08-09 18:11:48 +01:00
Richard van der Hoff
d7157843f4 Merge pull request #520 from matrix-org/rav/async_crypto/devicelist
Make some of DeviceList asynchronous
2017-08-09 18:02:53 +01:00
Richard van der Hoff
d317c1ff08 Merge pull request #519 from matrix-org/rav/async_crypto/algorithms
Make methods in crypto/algorithms async
2017-08-09 18:02:30 +01:00
Richard van der Hoff
ef889963d9 Rewrite olmlib.ensureOlmSessionsForDevices as async
This is non-functional. It just looks a lot prettier.
2017-08-09 10:46:19 +01:00
Richard van der Hoff
a2d7b221ee Make olmlib.verifySignature async 2017-08-09 10:46:18 +01:00
Richard van der Hoff
aff32afefa Make olmlib.encryptMessageForDevice async 2017-08-09 10:46:18 +01:00
Richard van der Hoff
0943e0c60f Make some of DeviceList asynchronous
* DeviceList._updateStoredDeviceKeysForUser
 * DeviceList._processQueryResponseForUser
 * DeviceList._storeDeviceKeys
2017-08-08 18:28:53 +01:00
Richard van der Hoff
18f75ec61c make algorithm.hasKeysForKeyRequest async 2017-08-08 18:26:31 +01:00
Richard van der Hoff
d821082843 Prepare megolm.js for async
Make internal methods of megolm.js ready for asynchronous olmdevice
2017-08-08 18:25:16 +01:00
Richard van der Hoff
366a88cc5c make olm._decryptMessage asynchronous 2017-08-08 18:22:55 +01:00
David Baker
951df61aa0 Merge pull request #518 from matrix-org/rav/no_plain_messages_in_e2e_room
Avoid sending unencrypted messages in e2e room
2017-08-08 12:48:49 +01:00
Richard van der Hoff
3e79575602 Avoid sending unencrypted messages in e2e room
Reshuffle the logic for determining whether to encrypt a message so that it can
run independently of whether our app actually supports e2e - and then throw an
error if it looks like we should be encrypting but don't support it.

This seems a preferable situation to just falling back to plain text if we get
a dodgy build.
2017-08-08 12:29:26 +01:00
David Baker
92e24777c0 Merge pull request #517 from matrix-org/rav/test_robustness
Make tests wait for syncs to happen
2017-08-08 11:27:13 +01:00
Richard van der Hoff
ab8d06bb86 Make tests wait for syncs to happen
Add lots of calls to `syncPromise` to cope with the fact that sync responses
are now handled asynchronously, which makes them prone to races otherwise.

Also a quick sanity-check in crypto to make one of the test failures less
cryptic.
2017-08-08 10:58:19 +01:00
Richard van der Hoff
8563dd5860 Merge pull request #510 from matrix-org/rav/async_crypto/crypto_methods
Make a load of methods in the 'Crypto' module asynchronous
2017-08-07 17:14:07 +01:00
Richard van der Hoff
1f6153fa82 Make Crypto.setRoomEncryption asynchronous 2017-08-07 17:13:09 +01:00
Richard van der Hoff
23d66b9746 Make Crypto.setDeviceVerification async 2017-08-07 17:13:09 +01:00
Richard van der Hoff
25ccd6bc6d Make Crypto._processReceivedRoomKeyRequests async
This is slightly complicated by the fact that it's initiated from a synchronous
process which we don't want to make async (processing the /sync response) and
we want to avoid racing two copies of the processor.
2017-08-07 17:13:09 +01:00
Richard van der Hoff
14ad32bcd2 Make Crypto.importRoomKeys async 2017-08-07 17:13:09 +01:00
Richard van der Hoff
9ab9b9d75a Make crypto._signObject async 2017-08-07 17:13:09 +01:00
Richard van der Hoff
b7a3c4557f Make crypto.getOlmSessionsForUser async
This is snever used anywhere (it's mosdly for debug), so this is trivial
2017-08-07 17:13:08 +01:00
David Baker
bdb90b4b33 Merge pull request #515 from matrix-org/luke/fix-null-rawDisplayName
Set `rawDisplayName` to `userId` if membership has `displayname=null`
2017-07-27 16:23:31 +01:00
Luke Barnard
85d0935e97 Set rawDisplayName to userId if membership has displayname=null
This mirrors the behaviour of `name` such that the default is always `userId` but if the membership event has a `displayname`, we use that.
2017-07-27 16:15:32 +01:00
Richard van der Hoff
86ad75d27b Merge pull request #508 from matrix-org/rav/async_crypto_event_handling
Refactor handling of crypto events for async
2017-07-26 09:07:59 +01:00
Richard van der Hoff
b40473aa3b Fix broken event-emitter test
We need to wait for two syncs, not just one, here.
2017-07-26 07:27:08 +01:00
Richard van der Hoff
3bd5ffc5cd Fix broken crypto test
Now that sync takes a bit longer to send out Event events, the encrypted events
have already been decrypted by the time the test sees them - so we no longer
need to await their decryption.
2017-07-26 07:20:02 +01:00
Richard van der Hoff
10aafd3738 Merge branch 'develop' into rav/async_crypto_event_handling 2017-07-26 07:11:48 +01:00
Richard van der Hoff
c055765bfe Merge pull request #509 from rav/async_crypto/async_decryption 2017-07-26 07:09:12 +01:00
Richard van der Hoff
d8f486fc0d Verbose logging to see what's up with indexeddb (#514)
In an attempt to see why our tests sometimes time out, add a load of logging to
confirm exactly where it is happening.
2017-07-25 11:38:27 +01:00
Luke Barnard
06eea71a37 Add rawDisplayName to RoomMember (#513)
* Add rawDisplayName to RoomMember

This will at first be the `userId`, but when the members membership event is set, `rawDisplayName` will be assigned to the raw `displayname` of the membership event. This deliberately avoids disambiguation so that clients can disambiguate themselves (via a tooltip or otherwise).

* Clarify docs
2017-07-24 17:35:53 +01:00
Richard van der Hoff
3effb9ec29 Merge pull request #511 from matrix-org/rav/async_to_bluebird
Transform `async` functions to bluebird promises
2017-07-24 10:26:26 +01:00
David Baker
6603a2300b Merge pull request #512 from matrix-org/dbkr/groupview_edit
Add more group APIs
2017-07-24 10:00:06 +01:00
David Baker
ed029fe348 More useful doc 2017-07-24 09:55:04 +01:00
Richard van der Hoff
b497bc5eb9 Fix broken test: wait for sync to complete 2017-07-21 16:04:53 +01:00
Richard van der Hoff
8a4a1dfadf Transform async functions to bluebird promises
Now that we use transform-runtime instead of regenerator-runtime, we need to
use the async-to-bluebird transform to make sure that `async` functions get
transformed into bluebird promises.
2017-07-21 15:59:30 +01:00
Richard van der Hoff
8bbf14acbf Let event decryption be asynchronous
Once everything moves to indexeddb, it's going to require callbacks and the
like, so let's make the decrypt API asynchronous in preparation.
2017-07-21 14:41:22 +01:00
Richard van der Hoff
86f2c86440 Add MatrixEvent.attemptDecryption
... and use it from both MatrixClient and the megolm re-decryption code.

This will help us avoid races when decryption is asynchronous.
2017-07-21 14:41:22 +01:00
Richard van der Hoff
cfb29f1339 Refactor handling of crypto events for async
We're going to need to handle m.room.crypto events asynchronously, so
restructure the way we do that.
2017-07-21 14:41:01 +01:00
Richard van der Hoff
63a28d8e34 Fix lint in /sync 2017-07-21 14:41:01 +01:00
Richard van der Hoff
d37cbb10a5 Merge pull request #507 from matrix-org/rav/fix_racy_cancellation_test
Retrying test: wait for localEchoUpdated event
2017-07-21 13:19:55 +01:00
David Baker
055590c0c6 Add more group APIs 2017-07-21 11:13:27 +01:00